Commit ee7f7a7f authored by Philipp Nowinski's avatar Philipp Nowinski
Browse files

[BUGFIX] fix early exit

parent 67d6ae2a
......@@ -146,13 +146,18 @@ module.exports = class Js extends Task {
));
}
bundler.pipe(fs.createWriteStream(_output));
// create the stream for writing the outFile
let outFile = fs.createWriteStream(_output, 'utf-8');
bundler.on('end', () => {
// wait for the stream to finish writing before calling success
outFile.on('finish', () => {
browserSync.reload('*.js');
this._logger.success(`Written ${chalk.white(path.basename(_output))}`);
resolve();
});
// announce the write stream as a build step
bundler.pipe(outFile);
} catch(_error) {
this._logger.error(_error.stack);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment