1 Star 1 Fork 0

carry_hu/react-h5-template

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
babel.config.js 968 Bytes
一键复制 编辑 原始数据 按行查看 历史
hushenbao 提交于 2021-09-09 16:08 . init
/**
* Babel的配置文件
*/
module.exports = function (api) {
api.cache(true); //缓存babel的配置文件,不再重复调用当前函数。
//预设转码
const presets = [
['@babel/env'], //用于支持IE9等老式浏览器使用新的JS语法,需要安装:@babel/preset-env
['@babel/react'] //用于支持IE9等老式浏览器使用React的语法,,需要安装:@babel/preset-react
];
//插件
const plugins = [
[
'import', //按需加载,需要安装babel-plugin-import
{libraryName: 'antd-mobile', libraryDirectory: 'es', style: true}
],
[
'@babel/plugin-proposal-decorators', //用来支持修饰器,需要安装:@babel/plugin-proposal-decorators
{legacy: true} //注意:legacy需要为true。
],
'transform-class-properties' //用于在class中声明属性(包含静态属性),需要安装:babel-plugin-transform-class-properties
];
return {presets, plugins};
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/carry_hu/react-h5-template.git
git@gitee.com:carry_hu/react-h5-template.git
carry_hu
react-h5-template
react-h5-template
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385