Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Fix watchOptions in webpack.config.js being ignored by WebpackDevMiddleware #850

Merged
merged 1 commit into from
Apr 11, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
});
}
Expand Down