From 2fabfdae1141d40cf07393ec43617b62ca028556 Mon Sep 17 00:00:00 2001 From: Amjad Masad Date: Fri, 17 Apr 2015 09:10:45 -0700 Subject: [PATCH] [react-packager] Add asset extensions to file watch glob in the project root --- react-packager/src/Server/index.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/react-packager/src/Server/index.js b/react-packager/src/Server/index.js index 3c7be043..e0bfeb2f 100644 --- a/react-packager/src/Server/index.js +++ b/react-packager/src/Server/index.js @@ -71,13 +71,17 @@ function Server(options) { this._packages = Object.create(null); this._changeWatchers = []; + var assetGlobs = opts.assetExts.map(function(ext) { + return '**/*.' + ext; + }); + var watchRootConfigs = opts.projectRoots.map(function(dir) { return { dir: dir, globs: [ '**/*.js', '**/package.json', - ] + ].concat(assetGlobs), }; }); @@ -86,9 +90,7 @@ function Server(options) { opts.assetRoots.map(function(dir) { return { dir: dir, - globs: opts.assetExts.map(function(ext) { - return '**/*.' + ext; - }), + globs: assetGlobs, }; }) );