[v9.2.x] Toolkit: Fix compilation loop when watching plugins for changes (#58695)
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
(cherry picked from commit ce50400740)
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
This commit is contained in:
co-authored by
Jack Westbrook
parent
0f0211f400
commit
d074471557
@@ -22,9 +22,8 @@ export const bundlePlugin = async ({ watch, production, preserveConsole }: Plugi
|
||||
const webpackPromise = new Promise<void>((resolve, reject) => {
|
||||
if (watch) {
|
||||
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', () => {
|
||||
clearConsole();
|
||||
console.log('Compiling...');
|
||||
|
||||
@@ -162,7 +162,6 @@ const getBaseWebpackConfig: WebpackConfigurationGetter = async (options) => {
|
||||
libraryTarget: 'amd',
|
||||
publicPath: '/',
|
||||
},
|
||||
|
||||
performance: { hints: false },
|
||||
externals: [
|
||||
'lodash',
|
||||
|
||||
Reference in New Issue
Block a user