Skip to content

Commit

Permalink
[Packager] NodeJS modules without polyfills redirect to null
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Sep 28, 2015
1 parent aebd1e0 commit 7cf7163
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
const debug = require('debug')('ReactPackager:DependencyGraph');
const util = require('util');
const path = require('path');
const inArray = require ('in-array');
const NODE_PATHS = require('node-paths');
const isAbsolutePath = require('absolute-path');
const getAssetDataFromName = require('../../lib/getAssetDataFromName');
const {sync} = require('io');
Expand Down Expand Up @@ -81,6 +83,11 @@ class ResolutionRequest {
toModuleName = globalConfig.resolve(toModuleName);
}

if (inArray(NODE_PATHS, toModuleName)
&& !this._hasteMap._map[toModuleName]) {
return this._getNullModule(toModuleName);
}

var promise = Q.reject();

if (toModuleName[0] !== '.' && toModuleName[0] !== '/') {
Expand Down

0 comments on commit 7cf7163

Please sign in to comment.