Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

"name": "webpack-project",
"scripts": {
"build": "webpack --mode=production --node-env=production",
"build": "webpack --mode=production --config-node-env=production",
"build:dev": "webpack --mode=development",
<% if (devServer) { %>
"serve": "webpack serve",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "My webpack project",
"name": "my-webpack-project",
"scripts": {
"build": "webpack --mode=production --node-env=production",
"build": "webpack --mode=production --config-node-env=production",
"build:dev": "webpack --mode=development",
"watch": "webpack --watch",
"serve": "webpack serve"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "My webpack project",
"name": "my-webpack-project",
"scripts": {
"build": "webpack --mode=production --node-env=production",
"build": "webpack --mode=production --config-node-env=production",
"build:dev": "webpack --mode=development",
"watch": "webpack --watch",
"serve": "webpack serve"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "My webpack project",
"name": "my-webpack-project",
"scripts": {
"build": "webpack --mode=production --node-env=production",
"build": "webpack --mode=production --config-node-env=production",
"build:dev": "webpack --mode=development",
"watch": "webpack --watch",
"serve": "webpack serve"
Expand Down
1 change: 0 additions & 1 deletion packages/webpack-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ Options:
-m, --merge Merge two or more configurations using 'webpack-merge'.
--disable-interpret Disable interpret for loading the config file.
--env <value...> Environment variables passed to the configuration when it is a function, e.g. "myvar" or "myvar=myval".
--node-env <value> Sets process.env.NODE_ENV to the specified value for access within the configuration.(Deprecated: Use '--config-node-env' instead)
--config-node-env <value> Sets process.env.NODE_ENV to the specified value for access within the configuration.
--analyze It invokes webpack-bundle-analyzer plugin to get bundle information.
--progress [value] Print compilation progress during build.
Expand Down
17 changes: 0 additions & 17 deletions packages/webpack-cli/src/webpack-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ interface Options {
config?: string[];
argv?: Argv;
env?: Env;
nodeEnv?: string;
configNodeEnv?: string;
watchOptionsStdin?: boolean;
watch?: boolean;
Expand Down Expand Up @@ -1016,18 +1015,6 @@ class WebpackCLI {
'Environment variables passed to the configuration when it is a function, e.g. "myvar" or "myvar=myval".',
helpLevel: "minimum",
},
{
name: "node-env",
configs: [
{
type: "string",
},
],
multiple: false,
description:
"Sets process.env.NODE_ENV to the specified value for access within the configuration.(Deprecated: Use '--config-node-env' instead)",
helpLevel: "minimum",
},
{
name: "config-node-env",
configs: [
Expand Down Expand Up @@ -2718,10 +2705,6 @@ class WebpackCLI {
if (typeof options.configNodeEnv === "string") {
process.env.NODE_ENV = options.configNodeEnv;
}
// TODO remove in the next major release
else if (typeof options.nodeEnv === "string") {
process.env.NODE_ENV = options.nodeEnv;
}

let config = await this.loadConfig(options);
config = await this.buildConfig(config, options);
Expand Down
5 changes: 0 additions & 5 deletions test/build/node-env/auto-mode.config.js

This file was deleted.

68 changes: 0 additions & 68 deletions test/build/node-env/node-env.test.js

This file was deleted.

1 change: 0 additions & 1 deletion test/build/node-env/src/index.js

This file was deleted.

6 changes: 0 additions & 6 deletions test/build/node-env/webpack.config.js

This file was deleted.

Loading
Loading