mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-02-20 02:58:05 +00:00
fix imports issue
This commit is contained in:
parent
9cd8449014
commit
20f4e7621b
@ -43,12 +43,20 @@ class Pipeline {
|
|||||||
|
|
||||||
importsList["Embark/EmbarkJS"] = utils.joinPath(fs.dappPath(), ".embark", 'embark.js');
|
importsList["Embark/EmbarkJS"] = utils.joinPath(fs.dappPath(), ".embark", 'embark.js');
|
||||||
importsList["Embark/web3"] = utils.joinPath(fs.dappPath(), ".embark", 'web3_instance.js');
|
importsList["Embark/web3"] = utils.joinPath(fs.dappPath(), ".embark", 'web3_instance.js');
|
||||||
|
importsList["Embark/contracts/SimpleStorage"] = utils.joinPath(fs.dappPath(), ".embark", 'SimpleStorage.js');
|
||||||
|
|
||||||
self.plugins.getPluginsProperty('imports', 'imports').forEach(function (importObject) {
|
self.plugins.getPluginsProperty('imports', 'imports').forEach(function (importObject) {
|
||||||
let [importName, importLocation] = importObject;
|
let [importName, importLocation] = importObject;
|
||||||
importsList[importName] = importLocation;
|
importsList[importName] = importLocation;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
for (let contractName in contractsJSON) {
|
||||||
|
let contractCode = self.buildContractJS(contractName);
|
||||||
|
let filePath = utils.joinPath(fs.dappPath(), ".embark", contractName + '.js');
|
||||||
|
fs.writeFileSync(filePath, contractCode);
|
||||||
|
importsList["Embark/contracts/" + contractName] = filePath;
|
||||||
|
}
|
||||||
|
|
||||||
let realCwd;
|
let realCwd;
|
||||||
|
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
@ -69,13 +77,13 @@ class Pipeline {
|
|||||||
if (request === utils.joinPath(fs.dappPath(), file.filename)) {
|
if (request === utils.joinPath(fs.dappPath(), file.filename)) {
|
||||||
callback();
|
callback();
|
||||||
} else {
|
} else {
|
||||||
if (request.indexOf('Embark/contracts/') === 0) {
|
//if (request.indexOf('Embark/contracts/') === 0) {
|
||||||
let contractName = request.split('/')[2];
|
// let contractName = request.split('/')[2];
|
||||||
let contractCode = self.buildContractJS(contractName);
|
// let contractCode = self.buildContractJS(contractName);
|
||||||
let filePath = utils.joinPath(fs.dappPath(), ".embark", contractName + '.js');
|
// let filePath = utils.joinPath(fs.dappPath(), ".embark", contractName + '.js');
|
||||||
fs.writeFileSync(filePath, contractCode);
|
// fs.writeFileSync(filePath, contractCode);
|
||||||
importsList[request] = filePath;
|
// importsList[request] = filePath;
|
||||||
}
|
//}
|
||||||
callback(null, "amd " + Math.random());
|
callback(null, "amd " + Math.random());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import EmbarkJS from 'Embark/EmbarkJS';
|
import EmbarkJS from 'Embark/EmbarkJS';
|
||||||
import SimpleStorage from 'Embark/contracts/SimpleStorage';
|
//import SimpleStorage from 'Embark/contracts/SimpleStorage';
|
||||||
import Test from 'Embark/contracts/Test';
|
import Test from 'Embark/contracts/Test';
|
||||||
import Assert from 'Embark/contracts/Assert';
|
import Assert from 'Embark/contracts/Assert';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user