Skip to content

Commit 6ded275

Browse files
committed
fix: close compiler, own sh script and output clearing
1 parent 2ed8c60 commit 6ded275

File tree

5 files changed

+645
-674
lines changed

5 files changed

+645
-674
lines changed

bin/cli.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@
2323
"migrate",
2424
"add",
2525
"remove",
26-
/*
27-
"update",
28-
"make",
29-
*/
3026
"serve",
3127
"generate-loader",
3228
"generate-plugin",
@@ -436,17 +432,17 @@ For more information, see https://webpack.js.org/api/cli/.`);
436432
if (argv.w) {
437433
compiler.hooks.watchRun.tap("WebpackInfo", compilation => {
438434
const compilationName = compilation.name ? compilation.name : "";
439-
console.log("\nCompilation " + compilationName + " starting…\n");
435+
console.error("\nCompilation " + compilationName + " starting…\n");
440436
});
441437
} else {
442438
compiler.hooks.beforeRun.tap("WebpackInfo", compilation => {
443439
const compilationName = compilation.name ? compilation.name : "";
444-
console.log("\nCompilation " + compilationName + " starting…\n");
440+
console.error("\nCompilation " + compilationName + " starting…\n");
445441
});
446442
}
447443
compiler.hooks.done.tap("WebpackInfo", compilation => {
448444
const compilationName = compilation.name ? compilation.name : "";
449-
console.log("\nCompilation " + compilationName + " finished\n");
445+
console.error("\nCompilation " + compilationName + " finished\n");
450446
});
451447
}
452448

@@ -491,8 +487,16 @@ For more information, see https://webpack.js.org/api/cli/.`);
491487
process.stdin.resume();
492488
}
493489
compiler.watch(watchOptions, compilerCallback);
494-
if (outputOptions.infoVerbosity !== "none") console.log("\nwebpack is watching the files…\n");
495-
} else compiler.run(compilerCallback);
490+
if (compiler.close) {
491+
compiler.close(compilerCallback);
492+
}
493+
if (outputOptions.infoVerbosity !== "none") console.error("\nwebpack is watching the files…\n");
494+
} else {
495+
compiler.run(compilerCallback);
496+
if (compiler.close) {
497+
compiler.close(compilerCallback);
498+
}
499+
}
496500
}
497501

498502
processOptions(options);

bin/convert-argv.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ module.exports = function(...args) {
7979
const ext = actualConfigFileName.replace(new RegExp(defaultConfigFileNames), "");
8080
configFiles.push({
8181
path: resolvedPath,
82-
ext,
82+
ext
8383
});
8484
}
8585
}

0 commit comments

Comments
 (0)