From 7a26cc813e48245db357680f8d6a91487317c6c2 Mon Sep 17 00:00:00 2001 From: Frank van Gemeren Date: Tue, 18 Sep 2018 21:05:13 +0200 Subject: [PATCH] Prevent async writes from being terminated before being written --- CHANGELOG.md | 3 +++ bin/run.js | 4 ++-- src/webpackWorker.js | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa2f0a0..30dd2fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Change Log +# master +- Switch from `process.exit()` to `process.exitCode` to prevent cutting off async writes + ## [v2.3.0](https://github.com/trivago/parallel-webpack/tree/v2.3.0) (2018-02-26) [Full Changelog](https://github.com/trivago/parallel-webpack/compare/v2.2.0...v2.3.0) diff --git a/bin/run.js b/bin/run.js index 8333429..a71eef2 100755 --- a/bin/run.js +++ b/bin/run.js @@ -56,7 +56,7 @@ if(argv.version) { } }).catch(function(err) { console.log(err.message); - process.exit(1); + process.exitCode = 1; }); } catch (e) { if(e.message) { @@ -65,6 +65,6 @@ if(argv.version) { } else { process.stdout.write(chalk.red('[WEBPACK]') + ' Could not load configuration ' + chalk.underline(process.cwd() + '/' + argv.config) + "\n"); } - process.exit(1); + process.exitCode = 1; } } diff --git a/src/webpackWorker.js b/src/webpackWorker.js index 8aa0080..0f720a5 100644 --- a/src/webpackWorker.js +++ b/src/webpackWorker.js @@ -99,7 +99,7 @@ module.exports = function(configuratorFileName, options, index, expectedConfigLe done({ message: chalk.red('[WEBPACK]') + ' Forcefully shut down ' + chalk.yellow(getAppName(webpackConfig)) }); - process.exit(0); + process.exitCode = 0; }, finishedCallback = function(err, stats) { if(err) {