Merge pull request #14461 from kaelig/honor-watchoptions

Pass watchOptions from webpack config to webpackDevMiddleware (v3 only)
This commit is contained in:
Michael Shilman 2021-04-09 09:16:31 +08:00 committed by GitHub
commit 486f611960
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -71,6 +71,7 @@ export const start: WebpackBuilder['start'] = async ({ startTime, options, route
publicPath: config.output?.publicPath as string,
writeToDisk: true,
logLevel: 'error',
watchOptions: config.watchOptions || {},
};
compilation = webpackDevMiddleware(compiler, middlewareOptions);

View File

@ -73,6 +73,7 @@ export const start: WebpackBuilder['start'] = async ({ startTime, options, route
const middlewareOptions: Parameters<typeof webpackDevMiddleware>[1] = {
publicPath: config.output?.publicPath as string,
writeToDisk: true,
watchOptions: config.watchOptions || {},
};
compilation = webpackDevMiddleware(compiler, middlewareOptions);