fix: kibana dev server not restarting for external plugin #171260 (#198246)

## Summary

Fixes #171260 the Kibana dev server not restarting during external
plugin development for server side code.

### Checklist


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)
- [ ] This will appear in the **Release Notes** and follow the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

## Release note
Fixes #171260 the Kibana dev server not restarting during external
plugin development for server side code.

---------

Co-authored-by: Brad White <Ikuni17@users.noreply.github.com>
This commit is contained in:
Jordan McAlpine 2024-11-20 15:24:58 -05:00 committed by GitHub
parent 393ffa58a0
commit 83b282a63a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);
}
}
},
{