File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -57,8 +57,14 @@ const { pathToFileURL } = require("url");
57
57
const util = require ( "util" ) ;
58
58
const { program, Option } = require ( "commander" ) ;
59
59
60
- const WEBPACK_PACKAGE = process . env . WEBPACK_PACKAGE || "webpack" ;
61
- const WEBPACK_DEV_SERVER_PACKAGE = process . env . WEBPACK_DEV_SERVER_PACKAGE || "webpack-dev-server" ;
60
+ const WEBPACK_PACKAGE_IS_CUSTOM = ! ! process . env . WEBPACK_PACKAGE ;
61
+ const WEBPACK_PACKAGE = WEBPACK_PACKAGE_IS_CUSTOM
62
+ ? ( process . env . WEBPACK_PACKAGE as string )
63
+ : "webpack" ;
64
+ const WEBPACK_DEV_SERVER_PACKAGE_IS_CUSTOM = ! ! process . env . WEBPACK_DEV_SERVER_PACKAGE ;
65
+ const WEBPACK_DEV_SERVER_PACKAGE = WEBPACK_DEV_SERVER_PACKAGE_IS_CUSTOM
66
+ ? ( process . env . WEBPACK_DEV_SERVER_PACKAGE as string )
67
+ : "webpack-dev-server" ;
62
68
63
69
interface Information {
64
70
Binaries ?: string [ ] ;
@@ -566,12 +572,12 @@ class WebpackCLI implements IWebpackCLI {
566
572
let skipInstallation = false ;
567
573
568
574
// Allow to use `./path/to/webpack.js` outside `node_modules`
569
- if ( dependency === WEBPACK_PACKAGE && fs . existsSync ( WEBPACK_PACKAGE ) ) {
575
+ if ( dependency === WEBPACK_PACKAGE && WEBPACK_PACKAGE_IS_CUSTOM ) {
570
576
skipInstallation = true ;
571
577
}
572
578
573
579
// Allow to use `./path/to/webpack-dev-server.js` outside `node_modules`
574
- if ( dependency === WEBPACK_DEV_SERVER_PACKAGE && fs . existsSync ( WEBPACK_PACKAGE ) ) {
580
+ if ( dependency === WEBPACK_DEV_SERVER_PACKAGE && WEBPACK_DEV_SERVER_PACKAGE_IS_CUSTOM ) {
575
581
skipInstallation = true ;
576
582
}
577
583
You can’t perform that action at this time.
0 commit comments