Skip to content

Commit 785141f

Browse files
lbogdanCompuIves
authored andcommitted
Webpack dev config: make "react-hot-loader/patch" first entry. (codesandbox#166)
1 parent def981f commit 785141f

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

config/webpack.dev.js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,20 @@ const devEntries = [
88
'webpack/hot/only-dev-server',
99
];
1010

11-
module.exports = merge(commonConfig, {
12-
devtool: 'eval',
13-
output: {
14-
filename: 'static/js/[name].js',
11+
module.exports = merge(
12+
// these go first, because "react-hot-loader/patch" has to be the first entry
13+
{
14+
entry: {
15+
app: devEntries,
16+
embed: devEntries,
17+
},
1518
},
16-
entry: {
17-
app: devEntries,
18-
embed: devEntries,
19-
},
20-
plugins: [new webpack.HotModuleReplacementPlugin()],
21-
});
19+
commonConfig,
20+
{
21+
devtool: 'eval',
22+
output: {
23+
filename: 'static/js/[name].js',
24+
},
25+
plugins: [new webpack.HotModuleReplacementPlugin()],
26+
}
27+
);

0 commit comments

Comments
 (0)