mirror of
https://github.com/status-im/react-native.git
synced 2025-01-10 09:35:48 +00:00
aff4cfb3b3
Reviewed By: cpojer Differential Revision: D2568166 fb-gh-sync-id: 8cedfd49ae4ce0de57a4ff3b499057c748803bd3
32 lines
1002 B
JavaScript
32 lines
1002 B
JavaScript
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*/
|
|
'use strict';
|
|
|
|
const createCacheKeyFunction = require('fbjs-scripts/jest/createCacheKeyFunction');
|
|
const path = require('path');
|
|
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\/)/)) {
|
|
return src;
|
|
}
|
|
|
|
return transformer.transform(src, file, {inlineRequires: true}).code;
|
|
},
|
|
|
|
getCacheKey: createCacheKeyFunction([
|
|
__filename,
|
|
path.join(__dirname, '../packager/transformer.js'),
|
|
path.join(__dirname, '../node_modules/babel-core/package.json'),
|
|
]),
|
|
};
|