diff --git a/src/lib/webpack/webpack-client-config.js b/src/lib/webpack/webpack-client-config.js index 8c9514cd9..fe7f68548 100644 --- a/src/lib/webpack/webpack-client-config.js +++ b/src/lib/webpack/webpack-client-config.js @@ -10,14 +10,19 @@ import PushManifestPlugin from './push-manifest'; import baseConfig from './webpack-base-config'; function clientConfig(env) { - const { isProd, source, src } = env; + const { isProd, source, src /*, port? */ } = env; - return { - entry: { - bundle: resolve(__dirname, './../entry'), - polyfills: resolve(__dirname, './polyfills') - }, + let entry = { + bundle: resolve(__dirname, './../entry'), + polyfills: resolve(__dirname, './polyfills') + }; + if (!isProd) { + entry['hmr'] = `webpack-dev-server/client?http://localhost:${process.env.PORT || env.port || 8080}`; + } + + return { + entry: entry, output: { path: env.dest, publicPath: '/', @@ -158,7 +163,7 @@ function isDev(config) { devServer: { inline: true, - hot: true, + /* setting hot:true will fuck up the HMR -- so DON'T! */ compress: true, publicPath: '/', contentBase: src,