Merge pull request #6446 from spalger/pr/6395

Updates to #6395
This commit is contained in:
Spencer 2016-03-07 15:08:59 -07:00
commit 1ea3bc1ef9
2 changed files with 16 additions and 11 deletions

View file

@ -146,7 +146,7 @@
"angular-mocks": "1.4.7",
"auto-release-sinon": "1.0.3",
"babel-eslint": "4.1.8",
"chokidar": "1.0.5",
"chokidar": "1.4.3",
"eslint": "1.10.3",
"eslint-plugin-mocha": "1.1.0",
"expect.js": "0.3.1",

View file

@ -1,8 +1,8 @@
import cluster from 'cluster';
const { join } = require('path');
const { join, resolve } = require('path');
const { format: formatUrl } = require('url');
import Hapi from 'hapi';
const { debounce, compact, get, invoke, bindAll, once, sample } = require('lodash');
const { debounce, compact, get, invoke, bindAll, once, sample, uniq } = require('lodash');
import Log from '../Log';
import Worker from './worker';
@ -85,14 +85,19 @@ module.exports = class ClusterManager {
const chokidar = require('chokidar');
const fromRoot = require('../../utils/fromRoot');
this.watcher = chokidar.watch([
'src/plugins',
'src/server',
'src/ui',
'src/utils',
'config',
...extraPaths
], {
const watchPaths = uniq(
[
fromRoot('src/plugins'),
fromRoot('src/server'),
fromRoot('src/ui'),
fromRoot('src/utils'),
fromRoot('config'),
...extraPaths
]
.map(path => resolve(path))
);
this.watcher = chokidar.watch(watchPaths, {
cwd: fromRoot('.'),
ignored: /[\\\/](\..*|node_modules|bower_components|public|__tests__)[\\\/]/
});