mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-23 01:58:29 +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);
|
const compiler = webpack(webpackConfig);
|
||||||
app.use(require('webpack-dev-middleware')(compiler, {
|
app.use(require('webpack-dev-middleware')(compiler, {
|
||||||
noInfo: true,
|
noInfo: true,
|
||||||
publicPath: webpackConfig.output.publicPath
|
publicPath: webpackConfig.output.publicPath,
|
||||||
|
watchOptions: webpackConfig.watchOptions
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// After each compilation completes, copy the in-memory filesystem to disk.
|
// 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) {
|
function beginWebpackWatcher(webpackConfig: webpack.Configuration) {
|
||||||
const compiler = webpack(webpackConfig);
|
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
|
// 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