mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Revert D5409825: [RN] Convert easy files to Prettier
Differential Revision: D5409825 fbshipit-source-id: f797a40b58bc6bcc6ae53ed820a10ab49d3f10f5
This commit is contained in:
committed by
Facebook Github Bot
parent
bfece1d800
commit
aafccdf622
@@ -6,7 +6,7 @@
|
||||
* 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.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
*/
|
||||
|
||||
/* eslint-env node */
|
||||
@@ -17,18 +17,22 @@ const babel = require('babel-core');
|
||||
const babelRegisterOnly = require('metro-bundler/src/babelRegisterOnly');
|
||||
const createCacheKeyFunction = require('fbjs-scripts/jest/createCacheKeyFunction');
|
||||
|
||||
const nodeFiles = RegExp(['/local-cli/', '/metro-bundler/'].join('|'));
|
||||
const nodeFiles = RegExp([
|
||||
'/local-cli/',
|
||||
'/metro-bundler/',
|
||||
].join('|'));
|
||||
const nodeOptions = babelRegisterOnly.config([nodeFiles]);
|
||||
|
||||
babelRegisterOnly([]);
|
||||
|
||||
const transformer = require('metro-bundler/src/transformer.js');
|
||||
module.exports = {
|
||||
process(src, file) {
|
||||
if (nodeFiles.test(file)) {
|
||||
// node specific transforms only
|
||||
return babel.transform(src, Object.assign({filename: file}, nodeOptions))
|
||||
.code;
|
||||
process(src/*: string*/, file/*: string*/) {
|
||||
if (nodeFiles.test(file)) { // node specific transforms only
|
||||
return babel.transform(
|
||||
src,
|
||||
Object.assign({filename: file}, nodeOptions)
|
||||
).code;
|
||||
}
|
||||
|
||||
return transformer.transform({
|
||||
|
||||
Reference in New Issue
Block a user