[react-packager] Add asset extensions to file watch glob in the project root

This commit is contained in:
Amjad Masad 2015-04-17 09:10:45 -07:00
parent 1883ba535c
commit 2975f26e80
1 changed files with 6 additions and 4 deletions

View File

@ -71,13 +71,17 @@ function Server(options) {
this._packages = Object.create(null); this._packages = Object.create(null);
this._changeWatchers = []; this._changeWatchers = [];
var assetGlobs = opts.assetExts.map(function(ext) {
return '**/*.' + ext;
});
var watchRootConfigs = opts.projectRoots.map(function(dir) { var watchRootConfigs = opts.projectRoots.map(function(dir) {
return { return {
dir: dir, dir: dir,
globs: [ globs: [
'**/*.js', '**/*.js',
'**/package.json', '**/package.json',
] ].concat(assetGlobs),
}; };
}); });
@ -86,9 +90,7 @@ function Server(options) {
opts.assetRoots.map(function(dir) { opts.assetRoots.map(function(dir) {
return { return {
dir: dir, dir: dir,
globs: opts.assetExts.map(function(ext) { globs: assetGlobs,
return '**/*.' + ext;
}),
}; };
}) })
); );