diff --git a/packager.js b/packager.js index ca4e5c67..bed45201 100644 --- a/packager.js +++ b/packager.js @@ -45,6 +45,10 @@ if (options.root) { } } +if (!options.assetRoots) { + options.assetRoots = [path.resolve(__dirname, '..')]; +} + console.log('\n' + ' ===============================================================\n' + ' | Running packager on port ' + options.port + '. \n' + @@ -97,6 +101,7 @@ function getAppMiddleware(options) { blacklistRE: blacklist(false), cacheVersion: '2', transformModulePath: require.resolve('./transformer.js'), + assetRoots: options.assetRoots, }); } diff --git a/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js b/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js index a7bf1f53..918b1e06 100644 --- a/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js +++ b/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js @@ -134,13 +134,12 @@ DependecyGraph.prototype.resolveDependency = function( fromModule, depModuleId ) { - if (this._assetMap != null) { // Process asset requires. var assetMatch = depModuleId.match(/^image!(.+)/); if (assetMatch && assetMatch[1]) { if (!this._assetMap[assetMatch[1]]) { - console.warn('Cannot find asset: ' + assetMatch[1]); + debug('WARINING: Cannot find asset:', assetMatch[1]); return null; } return this._assetMap[assetMatch[1]];