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
pull/57482/head^2
Jack Westbrook 3 years ago committed by GitHub
parent 75c9350a5a
commit ce50400740
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      packages/grafana-toolkit/src/cli/tasks/plugin/bundle.ts
  2. 1
      packages/grafana-toolkit/src/config/webpack.plugin.config.ts

@ -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',

Loading…
Cancel
Save