From 121d94ff08a6b702fc296c230e2694a59ea58d72 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 21 Nov 2024 09:10:12 +1100 Subject: [PATCH] [8.x] fix: kibana dev server not restarting for external plugin #171260 (#198246) (#201040) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Backport This will backport the following commits from `main` to `8.x`: - [fix: kibana dev server not restarting for external plugin #171260 (#198246)](https://github.com/elastic/kibana/pull/198246) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Jordan McAlpine <128929391+mickalpine@users.noreply.github.com> --- packages/kbn-cli-dev-mode/src/watcher.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/kbn-cli-dev-mode/src/watcher.ts b/packages/kbn-cli-dev-mode/src/watcher.ts index 3c9763e0543aa..6dc11371d9582 100644 --- a/packages/kbn-cli-dev-mode/src/watcher.ts +++ b/packages/kbn-cli-dev-mode/src/watcher.ts @@ -26,7 +26,8 @@ const packageMatcher = makeMatcher([ /** * Any code that is outside of a package must match this in order to trigger a restart */ -const nonPackageMatcher = makeMatcher(['config/**/*.yml']); +const nonPackageMatcher = makeMatcher(['config/**/*.yml', 'plugins/**/server/**/*']); +const staticFileMatcher = makeMatcher(['plugins/**/kibana.json']); export interface Options { enabled: boolean; @@ -87,6 +88,10 @@ export class Watcher { if (result.type === 'non-package') { return nonPackageMatcher(result.repoRel) && fire(result.repoRel); } + + if (result.type === 'static') { + return staticFileMatcher(result.repoRel) && fire(result.repoRel); + } } }, {