mirror of https://github.com/embarklabs/embark.git
propagate env
This commit is contained in:
parent
9730c198d3
commit
311f9fc243
|
@ -100,6 +100,7 @@ class Engine {
|
||||||
this.events.emit("status", "Building Assets");
|
this.events.emit("status", "Building Assets");
|
||||||
const Pipeline = require('../pipeline/pipeline.js');
|
const Pipeline = require('../pipeline/pipeline.js');
|
||||||
const pipeline = new Pipeline({
|
const pipeline = new Pipeline({
|
||||||
|
env: this.env,
|
||||||
buildDir: this.config.buildDir,
|
buildDir: this.config.buildDir,
|
||||||
contractsFiles: this.config.contractsFiles,
|
contractsFiles: this.config.contractsFiles,
|
||||||
assetFiles: this.config.assetFiles,
|
assetFiles: this.config.assetFiles,
|
||||||
|
|
|
@ -12,6 +12,7 @@ require("babel-preset-es2017");
|
||||||
class Pipeline {
|
class Pipeline {
|
||||||
|
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
|
this.env = options.env;
|
||||||
this.buildDir = options.buildDir;
|
this.buildDir = options.buildDir;
|
||||||
this.contractsFiles = options.contractsFiles;
|
this.contractsFiles = options.contractsFiles;
|
||||||
this.assetFiles = options.assetFiles;
|
this.assetFiles = options.assetFiles;
|
||||||
|
@ -103,6 +104,7 @@ class Pipeline {
|
||||||
function runWebpack(next) {
|
function runWebpack(next) {
|
||||||
let built = false;
|
let built = false;
|
||||||
const webpackProcess = new ProcessLauncher({
|
const webpackProcess = new ProcessLauncher({
|
||||||
|
env: self.env,
|
||||||
modulePath: utils.joinPath(__dirname, 'webpackProcess.js'),
|
modulePath: utils.joinPath(__dirname, 'webpackProcess.js'),
|
||||||
logger: self.logger,
|
logger: self.logger,
|
||||||
events: self.events,
|
events: self.events,
|
||||||
|
@ -115,7 +117,7 @@ class Pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
webpackProcess.send({action: constants.pipeline.init, options: {}});
|
webpackProcess.send({action: constants.pipeline.init, options: {env: self.env}});
|
||||||
webpackProcess.send({action: constants.pipeline.build, file, importsList});
|
webpackProcess.send({action: constants.pipeline.build, file, importsList});
|
||||||
|
|
||||||
webpackProcess.once('result', constants.pipeline.built, (msg) => {
|
webpackProcess.once('result', constants.pipeline.built, (msg) => {
|
||||||
|
|
|
@ -14,6 +14,7 @@ class ProcessLauncher {
|
||||||
* @return {ProcessLauncher} The ProcessLauncher instance
|
* @return {ProcessLauncher} The ProcessLauncher instance
|
||||||
*/
|
*/
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
|
this.env = options.env;
|
||||||
this.name = path.basename(options.modulePath);
|
this.name = path.basename(options.modulePath);
|
||||||
this.process = child_process.fork(options.modulePath);
|
this.process = child_process.fork(options.modulePath);
|
||||||
this.logger = options.logger;
|
this.logger = options.logger;
|
||||||
|
|
|
@ -21,6 +21,7 @@ class ProcessWrapper {
|
||||||
*/
|
*/
|
||||||
constructor(_options) {
|
constructor(_options) {
|
||||||
this.interceptLogs();
|
this.interceptLogs();
|
||||||
|
this.env = _options ? _options.env : 'development';
|
||||||
this.events = new Events();
|
this.events = new Events();
|
||||||
|
|
||||||
this.pingParent();
|
this.pingParent();
|
||||||
|
|
Loading…
Reference in New Issue