Skip to content
Merged
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.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exports[`create-webpack-app cli recognizes '-t' as an alias for '--template' and
},
"name": "webpack-project",
"scripts": {
"build": "webpack --mode=production --node-env=production",
"build": "webpack --mode=production --config-node-env=production",
"build:dev": "webpack --mode=development",
"serve": "webpack serve",
"watch": "webpack --watch",
Expand All @@ -35,7 +35,7 @@ exports[`create-webpack-app cli should ask question when wrong template is suppl
},
"name": "webpack-project",
"scripts": {
"build": "webpack --mode=production --node-env=production",
"build": "webpack --mode=production --config-node-env=production",
"build:dev": "webpack --mode=development",
"serve": "webpack serve",
"watch": "webpack --watch",
Expand All @@ -54,7 +54,7 @@ exports[`create-webpack-app cli should configure WDS as opted 1`] = `
},
"name": "webpack-project",
"scripts": {
"build": "webpack --mode=production --node-env=production",
"build": "webpack --mode=production --config-node-env=production",
"build:dev": "webpack --mode=development",
"serve": "webpack serve",
"watch": "webpack --watch",
Expand Down Expand Up @@ -123,7 +123,7 @@ exports[`create-webpack-app cli should configure html-webpack-plugin as opted 1`
},
"name": "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",
},
Expand Down Expand Up @@ -197,7 +197,7 @@ exports[`create-webpack-app cli should configure workbox-webpack-plugin as opted
},
"name": "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",
},
Expand Down Expand Up @@ -274,7 +274,7 @@ exports[`create-webpack-app cli should generate ES6 project correctly 1`] = `
},
"name": "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",
},
Expand Down Expand Up @@ -344,7 +344,7 @@ exports[`create-webpack-app cli should generate default project when nothing is
},
"name": "webpack-project",
"scripts": {
"build": "webpack --mode=production --node-env=production",
"build": "webpack --mode=production --config-node-env=production",
"build:dev": "webpack --mode=development",
"serve": "webpack serve",
"watch": "webpack --watch",
Expand Down Expand Up @@ -427,7 +427,7 @@ exports[`create-webpack-app cli should generate folders if non existing generati
},
"name": "webpack-project",
"scripts": {
"build": "webpack --mode=production --node-env=production",
"build": "webpack --mode=production --config-node-env=production",
"build:dev": "webpack --mode=development",
"serve": "webpack serve",
"watch": "webpack --watch",
Expand All @@ -449,7 +449,7 @@ exports[`create-webpack-app cli should generate project when generationPath is s
},
"name": "webpack-project",
"scripts": {
"build": "webpack --mode=production --node-env=production",
"build": "webpack --mode=production --config-node-env=production",
"build:dev": "webpack --mode=development",
"serve": "webpack serve",
"watch": "webpack --watch",
Expand Down Expand Up @@ -484,7 +484,7 @@ exports[`create-webpack-app cli should generate react template with state and ro
},
"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",
"serve": "webpack serve",
"watch": "webpack --watch",
Expand Down Expand Up @@ -599,7 +599,7 @@ exports[`create-webpack-app cli should generate svelte template with prompt answ
},
"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",
"serve": "webpack serve",
"watch": "webpack --watch",
Expand Down Expand Up @@ -713,7 +713,7 @@ exports[`create-webpack-app cli should generate typescript project correctly 1`]
},
"name": "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",
},
Expand Down Expand Up @@ -801,7 +801,7 @@ exports[`create-webpack-app cli should generate vue template with store and rout
},
"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",
"serve": "webpack serve",
"watch": "webpack --watch",
Expand Down Expand Up @@ -914,7 +914,7 @@ exports[`create-webpack-app cli should use css preprocessor and css with postcss
},
"name": "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",
},
Expand Down Expand Up @@ -999,7 +999,7 @@ exports[`create-webpack-app cli should use to use css preprocessor with postcss
},
"name": "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",
},
Expand Down Expand Up @@ -1076,7 +1076,7 @@ exports[`create-webpack-app cli should work with 'new' alias 1`] = `
},
"name": "webpack-project",
"scripts": {
"build": "webpack --mode=production --node-env=production",
"build": "webpack --mode=production --config-node-env=production",
"build:dev": "webpack --mode=development",
"serve": "webpack serve",
"watch": "webpack --watch",
Expand All @@ -1094,7 +1094,7 @@ exports[`create-webpack-app cli uses yarn as the package manager when opted 1`]
},
"name": "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",
},
Expand Down
Loading