Don't transform node_modules in open source

Summary: We aren't ignoring node_modules so we apply our transform on *all of them*.

See https://github.com/facebook/react-native/pull/2942 and https://github.com/facebook/react-native/issues/2939

@​public

Reviewed By: @vjeux

Differential Revision: D2467324
This commit is contained in:
Christoph Pojer 2015-09-22 12:11:13 -07:00 committed by facebook-github-bot-4
parent a50b4ea7b9
commit cee01bef4f
1 changed files with 10 additions and 0 deletions

View File

@ -14,6 +14,16 @@ const transformer = require('../packager/transformer.js');
module.exports = {
process(src, file) {
// Don't transform node_modules, except react-tools which includes the
// untransformed copy of React
if (
file.match(/node_modules\/(?!react-tools\/)/) ||
// (TODO: balpert, cpojer): Remove this once react is updated to 0.14
file.endsWith('performanceNow.js')
) {
return src;
}
return transformer.transform(src, file).code;
},