fix imports issue

This commit is contained in:
Iuri Matias 2018-01-12 14:21:36 -05:00
parent 7bd1be0d05
commit 728aea6e04
4 changed files with 18 additions and 4 deletions

View File

@ -173,7 +173,7 @@ class Cmd {
program
.command('reset')
.description('resets embarks state on this dapp including clearing cache')
.action(function (file) {
.action(function () {
embark.initConfig('development', {
embarkConfig: 'embark.json', interceptLogs: false
});
@ -181,7 +181,6 @@ class Cmd {
});
}
versionCmd() {
program
.command('version')

View File

@ -4,7 +4,7 @@ var fs = require('../../core/fs.js');
var GethCommands = require('./geth_commands.js');
/*eslint complexity: ["error", 25]*/
/*eslint complexity: ["error", 26]*/
var Blockchain = function(options) {
this.blockchainConfig = options.blockchainConfig;
this.env = options.env || 'development';

View File

@ -36,6 +36,7 @@ class Pipeline {
let importsList = {};
//importsList["Embark/EmbarkJS"] = fs.embarkPath("js/embark.js");
importsList["Embark/EmbarkJS"] = utils.joinPath(fs.dappPath(), ".embark", 'embark.js');
importsList["Embark/web3"] = utils.joinPath(fs.dappPath(), ".embark", 'web3_instance.js');
@ -44,7 +45,10 @@ class Pipeline {
importsList[importName] = importLocation;
});
let realCwd;
async.waterfall([
function findImports(next) {
webpack({
entry: utils.joinPath(fs.dappPath(), file.filename),
@ -72,6 +76,12 @@ class Pipeline {
});
},
function changeCwd(next) {
realCwd = process.env.PWD;
process.chdir(fs.embarkPath(''));
next();
},
function runWebpack(next) {
webpack({
entry: utils.joinPath(fs.dappPath(), file.filename),
@ -110,6 +120,11 @@ class Pipeline {
next();
});
},
function changeCwdBack(next) {
process.chdir(realCwd);
next();
}
], function(_err, _result) {

View File

@ -51,7 +51,7 @@
"underscore.string": "^3.3.4",
"url-loader": "^0.6.2",
"web3": "1.0.0-beta.27",
"webpack": "^2.6.1",
"webpack": "^3.10.0",
"window-size": "^1.1.0"
},
"author": "Iuri Matias <iuri.matias@gmail.com>",