Disable hot reloading on production builds
derp
This commit is contained in:
parent
b0916a59f6
commit
f8adaed4a0
|
@ -5,7 +5,7 @@
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "webpack",
|
"build": "webpack",
|
||||||
"build:production": "webpack -p --optimize-minimize",
|
"build:production": "ENVIRONMENT=production webpack -p --optimize-minimize",
|
||||||
"watch": "webpack --progress --watch",
|
"watch": "webpack --progress --watch",
|
||||||
"start": "node serve.js"
|
"start": "node serve.js"
|
||||||
},
|
},
|
||||||
|
|
|
@ -5,6 +5,8 @@ const defines = {
|
||||||
"DEFAULT_WS_URI": process.env.WEBSOCKET_URI || "ws://localhost:8412/"
|
"DEFAULT_WS_URI": process.env.WEBSOCKET_URI || "ws://localhost:8412/"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const env = process.env.ENVIRONMENT || "development";
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
devtool: "source-map",
|
devtool: "source-map",
|
||||||
entry: [
|
entry: [
|
||||||
|
@ -50,10 +52,10 @@ module.exports = {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
plugins:[
|
plugins:[
|
||||||
new webpack.HotModuleReplacementPlugin(),
|
(env !== "production" && new webpack.HotModuleReplacementPlugin()),
|
||||||
new webpack.EnvironmentPlugin(defines),
|
new webpack.EnvironmentPlugin(defines),
|
||||||
new webpack.NamedModulesPlugin(),
|
new webpack.NamedModulesPlugin(),
|
||||||
],
|
].filter(p => p),
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
"react": "preact-compat",
|
"react": "preact-compat",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user