mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Fix watchOptions in webpack.config.js being ignored by WebpackDevMiddleware (#806)
This enables Docker HMR workflow and the workaround mentioned in this comment: https://github.com/aspnet/JavaScriptServices/issues/806#issuecomment-290081291
This commit is contained in:
committed by
Steve Sanderson
parent
b28f85236f
commit
c0205cfc4e
@@ -108,7 +108,8 @@ function attachWebpackDevMiddleware(app: any, webpackConfig: webpack.Configurati
|
||||
const compiler = webpack(webpackConfig);
|
||||
app.use(require('webpack-dev-middleware')(compiler, {
|
||||
noInfo: true,
|
||||
publicPath: webpackConfig.output.publicPath
|
||||
publicPath: webpackConfig.output.publicPath,
|
||||
watchOptions: webpackConfig.watchOptions
|
||||
}));
|
||||
|
||||
// After each compilation completes, copy the in-memory filesystem to disk.
|
||||
@@ -207,7 +208,7 @@ function pathJoinSafe(rootPath: string, filePath: string) {
|
||||
|
||||
function beginWebpackWatcher(webpackConfig: webpack.Configuration) {
|
||||
const compiler = webpack(webpackConfig);
|
||||
compiler.watch({ /* watchOptions */ }, (err, stats) => {
|
||||
compiler.watch(webpackConfig.watchOptions || {}, (err, stats) => {
|
||||
// The default error reporter is fine for now, but could be customized here in the future if desired
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user