Skip to content

Commit

Permalink
Don't transform node_modules in open source
Browse files Browse the repository at this point in the history
Summary: We aren't ignoring node_modules so we apply our transform on *all of them*.

See facebook#2942 and facebook#2939

@​public

Reviewed By: @vjeux

Differential Revision: D2467324
  • Loading branch information
cpojer authored and facebook-github-bot-4 committed Sep 22, 2015
1 parent a50b4ea commit cee01be
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions jestSupport/preprocessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},

Expand Down

0 comments on commit cee01be

Please sign in to comment.