metro/react-packager
Amjad Masad 95800d1564 [react-packager] Fix the confused node_modules detection function
Summary:
@public

We have a function that detects whether a give file is to be treated as a node_modules. If so it doesn't have access to the haste module map. There is an exception to this rule which is a few modules that are allowed to do that. Currently thats react-native, react-tools, and parse.

The current implementation had a bug where if you had `react-native` (or react-tools etc) in the name before the actual package root then the detection will be off. This fixes the problem by starting from the `lastIndexOf('node_modules')` directory, that way nothing confuses us.

Test Plan:
./runJestTests.sh
export OSS, patch, run e2e test
2015-06-24 15:20:35 -08:00
..
__mocks__ Replace bluebird with promise 2015-06-22 08:44:03 -08:00
example_project [ReactNative] Expanded license on js packager files 2015-03-23 11:28:51 -08:00
src [react-packager] Fix the confused node_modules detection function 2015-06-24 15:20:35 -08:00
.babelrc [react-packager] Rewrite dependency graph (support node_modules, speed, fix bugs etc) 2015-06-19 18:05:18 -08:00
.npmignore [react-packager][streamline oss] Move open sourced JS source to react-native-github 2015-02-19 21:25:11 -08:00
index.js [react-packager] Rewrite dependency graph (support node_modules, speed, fix bugs etc) 2015-06-19 18:05:18 -08:00