From 39221567acfcaa9220a8e2e3b4fe0af060e9f656 Mon Sep 17 00:00:00 2001 From: aleclarsoniv Date: Fri, 25 Sep 2015 20:28:24 -0700 Subject: [PATCH] [Packager] Add 'assetExts' to GlobalConfig --- packager/packager.js | 3 ++- packager/react-packager/src/GlobalConfig/index.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packager/packager.js b/packager/packager.js index c25897ef9d95db..a4d15ccfe52935 100644 --- a/packager/packager.js +++ b/packager/packager.js @@ -32,6 +32,7 @@ if (!fs.existsSync(path.resolve(__dirname, '..', 'node_modules'))) { var chalk = require('chalk'); var connect = require('connect'); +var globalConfig = require('./react-packager/src/GlobalConfig'); var ReactPackager = require('./react-packager'); var blacklist = require('./blacklist.js'); var checkNodeVersion = require('./checkNodeVersion'); @@ -197,7 +198,7 @@ function getAppMiddleware(options) { cacheVersion: '2', transformModulePath: transformerPath, assetRoots: assetRoots, - assetExts: ['png', 'jpeg', 'jpg'], + assetExts: globalConfig.assetExts, polyfillModuleNames: [ require.resolve( '../Libraries/JavaScriptAppEngine/polyfills/document.js' diff --git a/packager/react-packager/src/GlobalConfig/index.js b/packager/react-packager/src/GlobalConfig/index.js index 87a8caded24811..d26859055e9d0b 100644 --- a/packager/react-packager/src/GlobalConfig/index.js +++ b/packager/react-packager/src/GlobalConfig/index.js @@ -45,7 +45,7 @@ GlobalConfig.prototype = { json = {}; } - // TODO: Set properties here with values taken from `json` + this.assetExts = json.assetExts || ['png', 'jpeg', 'jpg']; log.moat(1); log.format(this, { label: 'Global config: ', unlimited: true });