mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[dev/server] ignore irrelevant changes in plugins (#11884)
* [dev/server] ignore changes in test,build,scripts,docs dirs at root of plugins * [dev/clusterManager] unwrap extra ignore paths
This commit is contained in:
parent
1d2341fc2b
commit
c2ccab8515
1 changed files with 21 additions and 5 deletions
|
@ -62,10 +62,23 @@ module.exports = class ClusterManager {
|
|||
bindAll(this, 'onWatcherAdd', 'onWatcherError', 'onWatcherChange');
|
||||
|
||||
if (opts.watch) {
|
||||
this.setupWatching([
|
||||
const extraPaths = [
|
||||
...settings.plugins.paths,
|
||||
...settings.plugins.scanDirs
|
||||
]);
|
||||
...settings.plugins.scanDirs,
|
||||
];
|
||||
|
||||
const extraIgnores = settings.plugins.scanDirs
|
||||
.map(scanDir => resolve(scanDir, '*'))
|
||||
.concat(settings.plugins.paths)
|
||||
.reduce((acc, path) => acc.concat(
|
||||
resolve(path, 'test'),
|
||||
resolve(path, 'build'),
|
||||
resolve(path, 'target'),
|
||||
resolve(path, 'scripts'),
|
||||
resolve(path, 'docs'),
|
||||
), []);
|
||||
|
||||
this.setupWatching(extraPaths, extraIgnores);
|
||||
}
|
||||
|
||||
else this.startCluster();
|
||||
|
@ -79,7 +92,7 @@ module.exports = class ClusterManager {
|
|||
}
|
||||
}
|
||||
|
||||
setupWatching(extraPaths) {
|
||||
setupWatching(extraPaths, extraIgnores) {
|
||||
const chokidar = require('chokidar');
|
||||
const { fromRoot } = require('../../utils');
|
||||
|
||||
|
@ -94,7 +107,10 @@ module.exports = class ClusterManager {
|
|||
|
||||
this.watcher = chokidar.watch(uniq(watchPaths), {
|
||||
cwd: fromRoot('.'),
|
||||
ignored: /[\\\/](\..*|node_modules|bower_components|public|__tests__|coverage)[\\\/]/
|
||||
ignored: [
|
||||
/[\\\/](\..*|node_modules|bower_components|public|__tests__|coverage)[\\\/]/,
|
||||
...extraIgnores
|
||||
]
|
||||
});
|
||||
|
||||
this.watcher.on('add', this.onWatcherAdd);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue