From 685e2681faacac0fff8558f9ba79f9091c4f611f Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Thu, 4 Feb 2021 16:45:30 +0530 Subject: [PATCH] feat: show '--node-env' in minimum help output --- OPTIONS.md | 1 + packages/webpack-cli/README.md | 1 + packages/webpack-cli/lib/webpack-cli.js | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/OPTIONS.md b/OPTIONS.md index 9cf47d8cec7..27f2f212c03 100644 --- a/OPTIONS.md +++ b/OPTIONS.md @@ -9,6 +9,7 @@ Options: --config-name Name of the configuration to use. -m, --merge Merge two or more configurations using 'webpack-merge'. --env Environment passed to the configuration when it is a function. + --node-env Sets process.env.NODE_ENV to the specified value. -h, --hot Enables Hot Module Replacement --no-hot Disables Hot Module Replacement. --analyze It invokes webpack-bundle-analyzer plugin to get bundle information. diff --git a/packages/webpack-cli/README.md b/packages/webpack-cli/README.md index a7248a715c6..86941f9f47a 100644 --- a/packages/webpack-cli/README.md +++ b/packages/webpack-cli/README.md @@ -85,6 +85,7 @@ npx webpack-cli --help verbose --config-name Name of the configuration to use. -m, --merge Merge two or more configurations using 'webpack-merge'. --env Environment passed to the configuration when it is a function. + --node-env Sets process.env.NODE_ENV to the specified value. --progress [value] Print compilation progress during build. -j, --json [value] Prints result as JSON or store it in a file. -d, --devtool Determine source maps to use. diff --git a/packages/webpack-cli/lib/webpack-cli.js b/packages/webpack-cli/lib/webpack-cli.js index 15be68263dc..11120bb7916 100644 --- a/packages/webpack-cli/lib/webpack-cli.js +++ b/packages/webpack-cli/lib/webpack-cli.js @@ -241,6 +241,7 @@ class WebpackCLI { 'json', 'name', 'output-path', + 'node-env', ]; const builtInFlags = [ @@ -299,7 +300,7 @@ class WebpackCLI { name: 'node-env', type: String, multiple: false, - description: 'Sets process.env.NODE_ENV to the specified value', + description: 'Sets process.env.NODE_ENV to the specified value.', }, // Adding more plugins