Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
babel.config.js 1009 Bytes
Copy Edit Raw Blame History
module.exports = (api, options) => {
const { NODE_ENV } = options || process.env;
const dev = NODE_ENV === 'development';
const modules = NODE_ENV === 'esm' ? false : 'commonjs';
if (api) {
api.cache(() => NODE_ENV);
}
const plugins = [
'lodash',
['@babel/plugin-proposal-class-properties', { loose: true }],
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-proposal-export-namespace-from',
'@babel/plugin-proposal-export-default-from',
['@babel/plugin-transform-runtime', { useESModules: !modules }]
];
return {
presets: [
['@babel/preset-env', { modules, loose: true }],
['@babel/preset-react', { development: dev }],
'@babel/typescript'
],
plugins,
env: {
coverage: {
plugins: [
[
'istanbul',
{
exclude: ['src/**/*Spec.js', 'test/**/*']
}
]
]
}
}
};
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化