Skip to content

Commit e2da1fc

Browse files
author
Mick Lawitzke
authored
Update hot-reload.md to work with monorepo
In a monorepo with multiple apps the paths should not be hardcoded: - `entry: ['webpack/hot/poll?100', './src/main.ts']` should be `entry: ['webpack/hot/poll?100', './apps/appname/src/main.ts']` - `new StartServerPlugin({ name: 'main.js' })` should be `new StartServerPlugin({ name: 'apps/appname/main.js' })` Depending on which app has been started.
1 parent eb242db commit e2da1fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/recipes/hot-reload.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const StartServerPlugin = require('start-server-webpack-plugin');
2828
module.exports = function(options) {
2929
return {
3030
...options,
31-
entry: ['webpack/hot/poll?100', './src/main.ts'],
31+
entry: ['webpack/hot/poll?100', options.entry],
3232
watch: true,
3333
externals: [
3434
nodeExternals({
@@ -39,7 +39,7 @@ module.exports = function(options) {
3939
...options.plugins,
4040
new webpack.HotModuleReplacementPlugin(),
4141
new webpack.WatchIgnorePlugin([/\.js$/, /\.d\.ts$/]),
42-
new StartServerPlugin({ name: 'main.js' }),
42+
new StartServerPlugin({ name: options.output.filename }),
4343
],
4444
};
4545
};

0 commit comments

Comments
 (0)