Skip to content

Commit dbd7490

Browse files
committed
setup webpack production deployment
1 parent 330a152 commit dbd7490

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "index.js",
66
"scripts": {
77
"clean": "rimraf dist",
8-
"build": "npm run clean && webpack",
8+
"build": "NODE_ENV=production npm run clean && webpack -p",
99
"serve": "webpack-dev-server"
1010
},
1111
"repository": "https://github.com/StephenGrider/WebpackProject",

webpack.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ module.exports = {
3535
}),
3636
new HtmlWebpackPlugin({
3737
template: 'src/index.html'
38+
}),
39+
new webpack.DefinePlugin({
40+
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
3841
})
3942
]
4043
};

0 commit comments

Comments
 (0)