代码拉取完成,页面将自动刷新
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
* @format
* @oncall react_native
*/
'use strict';
const crypto = require('crypto');
const fs = require('fs');
/*::
import type {BabelCoreOptions} from '@babel/core';
*/
const plugins = [
'babel-plugin-syntax-hermes-parser',
'babel-plugin-transform-flow-enums',
'@babel/plugin-transform-flow-strip-types',
'@babel/plugin-transform-modules-commonjs',
'@babel/plugin-syntax-class-properties',
'@babel/plugin-transform-react-jsx',
];
const presets /*: Array<string> */ = [];
function getConfig(api /*: any */) /*: BabelCoreOptions */ {
api.cache.never();
return {
babelrc: false,
browserslistConfigFile: false,
presets: presets.map(preset => require.resolve(preset)),
plugins: plugins.map(plugin => require.resolve(plugin)),
};
}
getConfig.getCacheKey = () /*: string */ => {
const dependencies = [...plugins, ...presets].map(dependency =>
require.resolve(`${dependency}/package.json`),
);
const hash = crypto.createHash('md5');
dependencies.forEach(dependency =>
hash.update('\0', 'utf8').update(fs.readFileSync(dependency)),
);
return hash.digest('hex');
};
module.exports = getConfig;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。