mirror of https://github.com/embarklabs/embark.git
log error when pipeline dies
This commit is contained in:
parent
611c2198a6
commit
3700323280
|
@ -101,15 +101,25 @@ class Pipeline {
|
||||||
// JS files
|
// JS files
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
function runWebpack(next) {
|
function runWebpack(next) {
|
||||||
|
let resulted = false;
|
||||||
const webpackProcess = new ProcessLauncher({
|
const webpackProcess = new ProcessLauncher({
|
||||||
modulePath: utils.joinPath(__dirname, 'webpackProcess.js'),
|
modulePath: utils.joinPath(__dirname, 'webpackProcess.js'),
|
||||||
logger: self.logger,
|
logger: self.logger,
|
||||||
events: self.events
|
events: self.events,
|
||||||
|
exitCallback: function (code) {
|
||||||
|
if (!resulted) {
|
||||||
|
return next(`File building of ${file.filename} exited with code ${code} before the process finished`);
|
||||||
|
}
|
||||||
|
if (code) {
|
||||||
|
self.logger(__('File building process exited with code ', code));
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
webpackProcess.send({action: constants.pipeline.init, options: {}});
|
webpackProcess.send({action: constants.pipeline.init, options: {}});
|
||||||
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) => {
|
||||||
|
resulted = true;
|
||||||
webpackProcess.kill();
|
webpackProcess.kill();
|
||||||
return next(msg.error);
|
return next(msg.error);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue