Disable hot reloading on production builds

derp
master
Drew DeVault 2018-03-03 15:41:22 -05:00
parent b0916a59f6
commit f8adaed4a0
2 changed files with 5 additions and 3 deletions

View File

@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"build": "webpack",
"build:production": "webpack -p --optimize-minimize",
"build:production": "ENVIRONMENT=production webpack -p --optimize-minimize",
"watch": "webpack --progress --watch",
"start": "node serve.js"
},

View File

@ -5,6 +5,8 @@ const defines = {
"DEFAULT_WS_URI": process.env.WEBSOCKET_URI || "ws://localhost:8412/"
};
const env = process.env.ENVIRONMENT || "development";
module.exports = {
devtool: "source-map",
entry: [
@ -50,10 +52,10 @@ module.exports = {
]
},
plugins:[
new webpack.HotModuleReplacementPlugin(),
(env !== "production" && new webpack.HotModuleReplacementPlugin()),
new webpack.EnvironmentPlugin(defines),
new webpack.NamedModulesPlugin(),
],
].filter(p => p),
resolve: {
alias: {
"react": "preact-compat",