Use dev-server for hot reload

This commit is contained in:
Pavel Djundik 2018-07-08 14:28:52 +03:00 committed by Pavel Djundik
parent 1d2a11729f
commit e931866aeb
2 changed files with 14 additions and 1 deletions

View File

@ -22,7 +22,7 @@
"test:browser": "webpack-dev-server --config=webpack.config-browser.js", "test:browser": "webpack-dev-server --config=webpack.config-browser.js",
"test:client": "nyc --nycrc-path=test/.nycrc-mocha-webpack mocha-webpack --colors --opts=test/mocha-webpack.opts", "test:client": "nyc --nycrc-path=test/.nycrc-mocha-webpack mocha-webpack --colors --opts=test/mocha-webpack.opts",
"test:server": "nyc --nycrc-path=test/.nycrc-mocha mocha --colors", "test:server": "nyc --nycrc-path=test/.nycrc-mocha mocha --colors",
"watch": "webpack --watch" "watch": "webpack-dev-server --hot --inline"
}, },
"keywords": [ "keywords": [
"lounge", "lounge",

View File

@ -141,6 +141,19 @@ const config = {
// socket.io uses debug, we don't need it // socket.io uses debug, we don't need it
new webpack.NormalModuleReplacementPlugin(/debug/, path.resolve(__dirname, "scripts/noop.js")), new webpack.NormalModuleReplacementPlugin(/debug/, path.resolve(__dirname, "scripts/noop.js")),
], ],
devServer: {
port: 9001,
proxy: {
"/": {
context: ['**', '!/css/**', '!/js/**'],
target: 'http://localhost:9000/',
},
"/socket.io": {
ws: true,
target: 'http://localhost:9000',
},
},
},
}; };
module.exports = config; module.exports = config;