Skip to content

Commit

Permalink
fix: add node env as prod in default template (#2614)
Browse files Browse the repository at this point in the history
  • Loading branch information
anshumanv committed Apr 10, 2021
1 parent e56bd70 commit 5ea478c
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 62 deletions.
4 changes: 2 additions & 2 deletions packages/generators/init-template/default/package.json.js
@@ -1,8 +1,8 @@
module.exports = (isUsingDevServer) => {
const scripts = {
build: 'webpack --mode=production',
build: 'webpack --mode=production --node-env=production',
'build:dev': 'webpack --mode=development',
'build:prod': 'webpack --mode=production',
'build:prod': 'webpack --mode=production --node-env=production',
watch: 'webpack --watch',
};
if (isUsingDevServer) {
Expand Down
60 changes: 30 additions & 30 deletions test/init/__snapshots__/init.test.js.snap.webpack4
Expand Up @@ -11,9 +11,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"serve": "webpack serve",
"watch": "webpack --watch",
},
Expand All @@ -31,9 +31,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"serve": "webpack serve",
"watch": "webpack --watch",
},
Expand Down Expand Up @@ -86,9 +86,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"serve": "webpack serve",
"watch": "webpack --watch",
},
Expand Down Expand Up @@ -145,9 +145,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"watch": "webpack --watch",
},
"version": "1.0.0",
Expand Down Expand Up @@ -201,9 +201,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"watch": "webpack --watch",
},
"version": "1.0.0",
Expand Down Expand Up @@ -255,9 +255,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"serve": "webpack serve",
"watch": "webpack --watch",
},
Expand All @@ -276,9 +276,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"serve": "webpack serve",
"watch": "webpack --watch",
},
Expand All @@ -297,9 +297,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"serve": "webpack serve",
"watch": "webpack --watch",
},
Expand All @@ -318,9 +318,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"watch": "webpack --watch",
},
"version": "1.0.0",
Expand Down Expand Up @@ -376,9 +376,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"watch": "webpack --watch",
},
"version": "1.0.0",
Expand Down Expand Up @@ -431,9 +431,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"watch": "webpack --watch",
},
"version": "1.0.0",
Expand Down Expand Up @@ -527,9 +527,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"watch": "webpack --watch",
},
"version": "1.0.0",
Expand Down Expand Up @@ -585,9 +585,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"watch": "webpack --watch",
},
"version": "1.0.0",
Expand Down Expand Up @@ -642,9 +642,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"watch": "webpack --watch",
},
"version": "1.0.0",
Expand Down Expand Up @@ -696,9 +696,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"watch": "webpack --watch",
},
"version": "1.0.0",
Expand Down
60 changes: 30 additions & 30 deletions test/init/__snapshots__/init.test.js.snap.webpack5
Expand Up @@ -11,9 +11,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"serve": "webpack serve",
"watch": "webpack --watch",
},
Expand All @@ -31,9 +31,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"serve": "webpack serve",
"watch": "webpack --watch",
},
Expand Down Expand Up @@ -86,9 +86,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"serve": "webpack serve",
"watch": "webpack --watch",
},
Expand Down Expand Up @@ -145,9 +145,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"watch": "webpack --watch",
},
"version": "1.0.0",
Expand Down Expand Up @@ -201,9 +201,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"watch": "webpack --watch",
},
"version": "1.0.0",
Expand Down Expand Up @@ -255,9 +255,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"serve": "webpack serve",
"watch": "webpack --watch",
},
Expand All @@ -276,9 +276,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"serve": "webpack serve",
"watch": "webpack --watch",
},
Expand All @@ -297,9 +297,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"serve": "webpack serve",
"watch": "webpack --watch",
},
Expand All @@ -318,9 +318,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"watch": "webpack --watch",
},
"version": "1.0.0",
Expand Down Expand Up @@ -376,9 +376,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"watch": "webpack --watch",
},
"version": "1.0.0",
Expand Down Expand Up @@ -431,9 +431,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"watch": "webpack --watch",
},
"version": "1.0.0",
Expand Down Expand Up @@ -527,9 +527,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"watch": "webpack --watch",
},
"version": "1.0.0",
Expand Down Expand Up @@ -585,9 +585,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"watch": "webpack --watch",
},
"version": "1.0.0",
Expand Down Expand Up @@ -642,9 +642,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"watch": "webpack --watch",
},
"version": "1.0.0",
Expand Down Expand Up @@ -696,9 +696,9 @@ Object {
},
"name": "my-webpack-project",
"scripts": Object {
"build": "webpack --mode=production",
"build": "webpack --mode=production --node-env=production",
"build:dev": "webpack --mode=development",
"build:prod": "webpack --mode=production",
"build:prod": "webpack --mode=production --node-env=production",
"watch": "webpack --watch",
},
"version": "1.0.0",
Expand Down

0 comments on commit 5ea478c

Please sign in to comment.