File tree Expand file tree Collapse file tree 1 file changed +29
-5
lines changed Expand file tree Collapse file tree 1 file changed +29
-5
lines changed Original file line number Diff line number Diff line change @@ -521,16 +521,40 @@ NODE_OPTIONS="--max-old-space-size=4096 -r /path/to/preload/file.js" webpack
521
521
522
522
## CLI Environment Variables
523
523
524
- | Environment Variable | Description |
525
- | ----------------------------------- | ------------------------------------------------------------------- |
526
- | ` WEBPACK_CLI_SKIP_IMPORT_LOCAL ` | when ` true ` it will skip using the local instance of ` webpack-cli ` . |
527
- | ` WEBPACK_CLI_FORCE_LOAD_ESM_CONFIG ` | when ` true ` it will force load the ESM config. |
528
- | ` WEBPACK_PACKAGE ` | Use a custom webpack version in CLI. |
524
+ | Environment Variable | Description |
525
+ | ------------------------------------- | ------------------------------------------------------------------- |
526
+ | ` WEBPACK_CLI_SKIP_IMPORT_LOCAL ` | when ` true ` it will skip using the local instance of ` webpack-cli ` . |
527
+ | ` WEBPACK_CLI_FORCE_LOAD_ESM_CONFIG ` | when ` true ` it will force load the ESM config. |
528
+ | [ ` WEBPACK_PACKAGE ` ] ( #webpack_package ) | Use a custom webpack version in CLI. |
529
529
530
530
``` bash
531
531
WEBPACK_CLI_FORCE_LOAD_ESM_CONFIG=true npx webpack --config ./webpack.config.esm
532
532
```
533
533
534
+ ### WEBPACK_PACKAGE
535
+
536
+ Use a custom webpack version in CLI. Considering the following content in your ` package.json ` :
537
+
538
+ ``` json
539
+ {
540
+ "webpack" : " ^4.0.0" ,
541
+ "webpack-5" : " npm:webpack@^5.32.0" ,
542
+ "webpack-cli" : " ^4.5.0"
543
+ }
544
+ ```
545
+
546
+ To use ` webpack v4.0.0 ` :
547
+
548
+ ``` bash
549
+ npx webpack
550
+ ```
551
+
552
+ To use ` webpack v5.32.0 ` :
553
+
554
+ ``` bash
555
+ WEBPACK_PACKAGE=webpack-5 npx webpack
556
+ ```
557
+
534
558
## ENV Environment Variables
535
559
536
560
| Environment Variable | Description |
You can’t perform that action at this time.
0 commit comments