加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
babel.config.js 848 Bytes
一键复制 编辑 原始数据 按行查看 历史
Pranav Raj S 提交于 2020-04-17 18:49 . Chore: Upgrade babel packages (#736)
/* eslint-disable global-require */
const plugins = () => [
require('babel-plugin-macros'),
[
require('@babel/plugin-proposal-class-properties').default,
{
loose: true,
},
],
[require('babel-plugin-transform-vue-jsx')],
];
module.exports = api => {
const validEnv = ['development', 'test', 'production'];
const currentEnv = api.env();
if (!validEnv.includes(currentEnv)) {
throw new Error(
`${'Please specify a valid `NODE_ENV` or ' +
'`BABEL_ENV` environment variables. Valid values are "development", ' +
'"test", and "production". Instead, received: '}${JSON.stringify(
currentEnv
)}.`
);
}
return {
presets: [
[
require('@babel/preset-env').default,
{ useBuiltIns: 'usage', corejs: 3 },
],
],
plugins: plugins(),
};
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化