From e931866aeb043e36bc6d2f3f783f92888f235858 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Sun, 8 Jul 2018 14:28:52 +0300 Subject: [PATCH] Use dev-server for hot reload --- package.json | 2 +- webpack.config.js | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 329d31ba..171e3318 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "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:server": "nyc --nycrc-path=test/.nycrc-mocha mocha --colors", - "watch": "webpack --watch" + "watch": "webpack-dev-server --hot --inline" }, "keywords": [ "lounge", diff --git a/webpack.config.js b/webpack.config.js index 0fc64874..8637ae9a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -141,6 +141,19 @@ const config = { // socket.io uses debug, we don't need it 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;