Skip to content

Commit 047e922

Browse files
authored
Merge pull request #417 from zouhir/hmr-fix
hmr fix
2 parents 6f2da0b + 427087f commit 047e922

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/lib/webpack/webpack-client-config.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,19 @@ import PushManifestPlugin from './push-manifest';
1010
import baseConfig from './webpack-base-config';
1111

1212
function clientConfig(env) {
13-
const { isProd, source, src } = env;
13+
const { isProd, source, src /*, port? */ } = env;
1414

15-
return {
16-
entry: {
17-
bundle: resolve(__dirname, './../entry'),
18-
polyfills: resolve(__dirname, './polyfills')
19-
},
15+
let entry = {
16+
bundle: resolve(__dirname, './../entry'),
17+
polyfills: resolve(__dirname, './polyfills')
18+
};
2019

20+
if (!isProd) {
21+
entry['hmr'] = `webpack-dev-server/client?http://localhost:${process.env.PORT || env.port || 8080}`;
22+
}
23+
24+
return {
25+
entry: entry,
2126
output: {
2227
path: env.dest,
2328
publicPath: '/',
@@ -158,7 +163,7 @@ function isDev(config) {
158163

159164
devServer: {
160165
inline: true,
161-
hot: true,
166+
/* setting hot:true will fuck up the HMR -- so DON'T! */
162167
compress: true,
163168
publicPath: '/',
164169
contentBase: src,

0 commit comments

Comments
 (0)