diff --git a/lib/cmd.js b/lib/cmd.js index 52cb113e..3201e76d 100644 --- a/lib/cmd.js +++ b/lib/cmd.js @@ -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') diff --git a/lib/cmds/blockchain/blockchain.js b/lib/cmds/blockchain/blockchain.js index 83aa747b..5ac8981f 100644 --- a/lib/cmds/blockchain/blockchain.js +++ b/lib/cmds/blockchain/blockchain.js @@ -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'; diff --git a/lib/pipeline/pipeline.js b/lib/pipeline/pipeline.js index 5c611166..4b883ed0 100644 --- a/lib/pipeline/pipeline.js +++ b/lib/pipeline/pipeline.js @@ -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) { diff --git a/package.json b/package.json index 8c45a11e..b857e88c 100644 --- a/package.json +++ b/package.json @@ -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 ",