Skip to content

Commit cee01be

Browse files
cpojerfacebook-github-bot-4
authored andcommitted
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 facebook/react-native#2942 and facebook/react-native#2939 @​public Reviewed By: @vjeux Differential Revision: D2467324
1 parent a50b4ea commit cee01be

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

jestSupport/preprocessor.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ const transformer = require('../packager/transformer.js');
1414

1515
module.exports = {
1616
process(src, file) {
17+
// Don't transform node_modules, except react-tools which includes the
18+
// untransformed copy of React
19+
if (
20+
file.match(/node_modules\/(?!react-tools\/)/) ||
21+
// (TODO: balpert, cpojer): Remove this once react is updated to 0.14
22+
file.endsWith('performanceNow.js')
23+
) {
24+
return src;
25+
}
26+
1727
return transformer.transform(src, file).code;
1828
},
1929

0 commit comments

Comments
 (0)