Skip to content

Commit 7235664

Browse files
docs: update
1 parent 5134eeb commit 7235664

File tree

5 files changed

+873
-748
lines changed

5 files changed

+873
-748
lines changed

OPTIONS.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ Options:
1111
--disable-interpret Disable interpret for loading the config file.
1212
--env <value...> Environment passed to the configuration when it is a function.
1313
--node-env <value> Sets process.env.NODE_ENV to the specified value.
14-
--define-process-env-node-env <value> Sets process.env.NODE_ENV to the specified value. (Currently an alias for `--node-env`)
14+
--define-process-env-node-env <value> Sets process.env.NODE_ENV to the specified value. (Currently an alias for `--node-env`).
1515
--analyze It invokes webpack-bundle-analyzer plugin to get bundle information.
1616
--progress [value] Print compilation progress during build.
1717
-j, --json [value] Prints result as JSON or store it in a file.
18-
--fail-on-warnings Stop webpack-cli process with non-zero exit code on warnings from webpack
18+
--fail-on-warnings Stop webpack-cli process with non-zero exit code on warnings from webpack.
19+
-e, --extends <value...> Path to the configuration to be extended (only works when using webpack-cli).
1920
--no-amd Negative 'amd' option.
2021
--bail Report the first error as a hard error instead of tolerating it.
2122
--no-bail Negative 'bail' option.
@@ -97,6 +98,8 @@ Options:
9798
--no-experiments-sync-web-assembly Negative 'experiments-sync-web-assembly' option.
9899
--experiments-top-level-await Allow using top-level-await in EcmaScript Modules.
99100
--no-experiments-top-level-await Negative 'experiments-top-level-await' option.
101+
--extends <value...> Path to the configuration to be extended (only works when using webpack-cli).
102+
--extends-reset Clear all items provided in 'extends' configuration. Extend configuration from another configuration (only works when using webpack-cli).
100103
--externals <value...> Every matched dependency becomes external. An exact matched dependency becomes external. The same string is used as external dependency.
101104
--externals-reset Clear all items provided in 'externals' configuration. Specify dependencies that shouldn't be resolved by webpack, but should become dependencies of the resulting bundle. The kind of the dependency depends on `output.libraryTarget`.
102105
--externals-presets-electron Treat common electron built-in modules in main and preload context like 'electron', 'ipc' or 'shell' as external and load them via require() when used.
@@ -640,6 +643,8 @@ Options:
640643
--output-hot-update-chunk-filename <value> The filename of the Hot Update Chunks. They are inside the output.path directory.
641644
--output-hot-update-global <value> The global variable used by webpack for loading of hot update chunks.
642645
--output-hot-update-main-filename <value> The filename of the Hot Update Main File. It is inside the 'output.path' directory.
646+
--output-ignore-browser-warnings Ignore warnings in the browser.
647+
--no-output-ignore-browser-warnings Negative 'output-ignore-browser-warnings' option.
643648
--output-iife Wrap javascript code into IIFE's to avoid leaking into global scope.
644649
--no-output-iife Negative 'output-iife' option.
645650
--output-import-function-name <value> The name of the native import() function (can be exchanged for a polyfill).
@@ -682,6 +687,7 @@ Options:
682687
--output-strict-module-exception-handling Handles exceptions in module loading correctly at a performance cost (Deprecated). This will handle module error compatible with the Node.js CommonJS way.
683688
--no-output-strict-module-exception-handling Negative 'output-strict-module-exception-handling' option.
684689
--output-trusted-types [value] Use a Trusted Types policy to create urls for chunks. 'output.uniqueName' is used a default policy name. Passing a string sets a custom policy name. The name of the Trusted Types policy created by webpack to serve bundle chunks.
690+
--output-trusted-types-on-policy-creation-failure <value> If the call to `trustedTypes.createPolicy(...)` fails -- e.g., due to the policy name missing from the CSP `trusted-types` list, or it being a duplicate name, etc. -- controls whether to continue with loading in the hope that `require-trusted-types-for 'script'` isn't enforced yet, versus fail immediately. Default behavior is 'stop'.
685691
--output-trusted-types-policy-name <value> The name of the Trusted Types policy created by webpack to serve bundle chunks.
686692
--output-unique-name <value> A unique name of the webpack build to avoid multiple webpack runtimes to conflict when using globals.
687693
--output-wasm-loading <value> The method of loading WebAssembly Modules (methods included by default are 'fetch' (web/WebWorker), 'async-node' (node.js), but others might be added by plugins).
@@ -890,6 +896,7 @@ Options:
890896
--no-stats-errors Negative 'stats-errors' option.
891897
--stats-errors-count Add errors count.
892898
--no-stats-errors-count Negative 'stats-errors-count' option.
899+
--stats-errors-space <value> Space to display errors (value is in number of lines).
893900
--stats-exclude-assets <value...> Suppress assets that match the specified filters. Filters can be Strings, RegExps or Functions.
894901
--stats-exclude-assets-reset Clear all items provided in 'stats.excludeAssets' configuration. Suppress assets that match the specified filters. Filters can be Strings, RegExps or Functions.
895902
--stats-exclude-modules [value...] Suppress modules that match the specified filters. Filters can be Strings, RegExps, Booleans or Functions.
@@ -978,6 +985,7 @@ Options:
978985
--no-stats-warnings-count Negative 'stats-warnings-count' option.
979986
--stats-warnings-filter <value...> Suppress listing warnings that match the specified filters (they will still be counted). Filters can be Strings, RegExps or Functions.
980987
--stats-warnings-filter-reset Clear all items provided in 'stats.warningsFilter' configuration. Suppress listing warnings that match the specified filters (they will still be counted). Filters can be Strings, RegExps or Functions.
988+
--stats-warnings-space <value> Space to display warnings (value is in number of lines).
981989
-t, --target <value...> Environment to build for. Environment to build for. An array of environments to build for all of them when possible.
982990
--no-target Negative 'target' option.
983991
--target-reset Clear all items provided in 'target' configuration. Environment to build for. An array of environments to build for all of them when possible.

SERVE-OPTIONS-v4.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ Options:
1010
--disable-interpret Disable interpret for loading the config file.
1111
--env <value...> Environment passed to the configuration when it is a function.
1212
--node-env <value> Sets process.env.NODE_ENV to the specified value.
13-
--define-process-env-node-env <value> Sets process.env.NODE_ENV to the specified value. (Currently an alias for `--node-env`)
1413
--analyze It invokes webpack-bundle-analyzer plugin to get bundle information.
1514
--progress [value] Print compilation progress during build.
1615
-j, --json [value] Prints result as JSON or store it in a file.
17-
--fail-on-warnings Stop webpack-cli process with non-zero exit code on warnings from webpack
16+
--fail-on-warnings Stop webpack-cli process with non-zero exit code on warnings from webpack.
17+
-e, --extends <value...> Path to the configuration to be extended (only works when using webpack-cli).
1818
-d, --devtool <value> A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
1919
--no-devtool Negative 'devtool' option.
2020
--entry <value...> A module that is loaded upon startup. Only the last one is exported.
21+
--extends <value...> Path to the configuration to be extended (only works when using webpack-cli).
2122
--mode <value> Enable production optimizations or development hints.
2223
--name <value> Name of the configuration. Used when loading multiple configurations.
2324
-o, --output-path <value> The output directory as **absolute path** (required).

packages/webpack-cli/src/webpack-cli.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -916,8 +916,8 @@ class WebpackCLI implements IWebpackCLI {
916916
],
917917
multiple: false,
918918
description:
919-
"Sets process.env.NODE_ENV to the specified value. (Currently an alias for `--node-env`)",
920-
helpLevel: "minimum",
919+
"Sets process.env.NODE_ENV to the specified value. (Currently an alias for `--node-env`).",
920+
helpLevel: "verbose",
921921
},
922922

923923
// Adding more plugins
@@ -972,9 +972,10 @@ class WebpackCLI implements IWebpackCLI {
972972
values: [true],
973973
},
974974
],
975-
description: "Stop webpack-cli process with non-zero exit code on warnings from webpack",
975+
description: "Stop webpack-cli process with non-zero exit code on warnings from webpack.",
976976
helpLevel: "minimum",
977977
},
978+
// TODO remove this in the next major release, because not all webpack versions have this flag in CLI options
978979
{
979980
name: "extends",
980981
alias: "e",
@@ -984,7 +985,8 @@ class WebpackCLI implements IWebpackCLI {
984985
},
985986
],
986987
multiple: true,
987-
description: "Extend webpack configuration",
988+
description:
989+
"Path to the configuration to be extended (only works when using webpack-cli).",
988990
helpLevel: "minimum",
989991
},
990992
];
@@ -999,6 +1001,7 @@ class WebpackCLI implements IWebpackCLI {
9991001
"target",
10001002
"name",
10011003
"output-path",
1004+
"extends",
10021005
];
10031006

10041007
// Extract all the flags being exported from core.

0 commit comments

Comments
 (0)