TypeScript & Babel All In One
TypeScript & Babel All In One
$ yarn add -D @babel/cli @babel/core @babel/preset-env @babel/preset-typescript
{
"presets": [
["@babel/preset-env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}],
"@babel/preset-react"
],
"plugins": [
"lodash",
"@babel/plugin-transform-runtime",
["@babel/plugin-proposal-decorators", { "legacy": true }],
"@babel/plugin-proposal-class-properties",
"@babel/plugin-syntax-dynamic-import",
"react-hot-loader/babel",
[
"import",
{
"libraryName": "antd",
"style": true
}
]
]
}
{
"@babel/core": "7.8.0",
"@babel/eslint-parser": "7.11.4",
"babel-loader": "8.1.0",
"babel-plugin-import": "1.13.0",
"babel-plugin-lodash": "3.3.4",
"@babel/plugin-syntax-dynamic-import": "7.8.3",
"@babel/plugin-proposal-class-properties": "7.10.4",
"@babel/plugin-proposal-decorators": "7.10.5",
"@babel/plugin-transform-runtime": "7.11.0",
"@babel/preset-env": "7.11.0",
"@babel/preset-react": "7.10.4",
"@babel/runtime": "7.11.2",
}
new react project
babel 7+
babel
old react project
babel 6-
tsc + babel
refs
©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/14613485.html
未经授权禁止转载,违者必究!