Toolkit: Fix compilation loop when watching plugins for changes (#58167)

* fix(toolkit): ignore node_modules and dist directories when watching for changes to plugin

* fix(toolkit): move watchOptions.ignored config to pluginDev watch call
This commit is contained in:
Jack Westbrook 2022-11-14 09:30:52 +01:00 committed by GitHub
parent 75c9350a5a
commit ce50400740
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 3 deletions

View File

@ -22,9 +22,8 @@ export const bundlePlugin = async ({ watch, production, preserveConsole }: Plugi
const webpackPromise = new Promise<void>((resolve, reject) => { const webpackPromise = new Promise<void>((resolve, reject) => {
if (watch) { if (watch) {
console.log('Started watching plugin for changes...'); console.log('Started watching plugin for changes...');
compiler.watch({}, (err, stats) => {}); compiler.watch({ ignored: ['**/node_modules', '**/dist'] }, (err, stats) => {});
// @ts-ignore
compiler.hooks.invalid.tap('invalid', () => { compiler.hooks.invalid.tap('invalid', () => {
clearConsole(); clearConsole();
console.log('Compiling...'); console.log('Compiling...');

View File

@ -162,7 +162,6 @@ const getBaseWebpackConfig: WebpackConfigurationGetter = async (options) => {
libraryTarget: 'amd', libraryTarget: 'amd',
publicPath: '/', publicPath: '/',
}, },
performance: { hints: false }, performance: { hints: false },
externals: [ externals: [
'lodash', 'lodash',