Skip to content

Commit b6b3155

Browse files
committed
Pass in webpack mode through CLI
1 parent 5ea5378 commit b6b3155

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252
},
5353
"scripts": {
5454
"build-proto": "pbf src/proto/rpcEvent.proto > src/generated/rpcEvent.js && pbf src/proto/rpcMessage.proto > src/generated/rpcMessage.js",
55-
"build": "npm run build-proto && webpack --env.production && tsc --build tsconfig.build-server.json",
56-
"watch": "npm run build-proto && concurrently \"webpack --watch\" \"tsc --build tsconfig.build-server.json --watch\"",
55+
"build": "npm run build-proto && webpack --mode=production && tsc --build tsconfig.build-server.json",
56+
"watch": "npm run build-proto && concurrently \"webpack --mode=development --watch\" \"tsc --build tsconfig.build-server.json --watch\"",
5757
"test": "echo \"Error: no test specified\" && exit 1",
5858
"lint": "eslint --ext .ts,.tsx src/"
5959
},

webpack.config.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
const path = require("path");
22
const HtmlWebpackPlugin = require("html-webpack-plugin");
33

4-
const makeConfig = (env = {}) => ({
5-
mode: env.production ? "production" : "development",
4+
module.exports = {
65
module: {
76
rules: [
87
{
@@ -25,6 +24,4 @@ const makeConfig = (env = {}) => ({
2524
template: "./src/client/index.html"
2625
})
2726
]
28-
});
29-
30-
module.exports = makeConfig;
27+
};

0 commit comments

Comments
 (0)