Skip to content

Commit

Permalink
feat: babel支持ts4.5 import type语法
Browse files Browse the repository at this point in the history
  • Loading branch information
typistZxd committed May 5, 2022
1 parent 83036ec commit 9663108
Show file tree
Hide file tree
Showing 3 changed files with 791 additions and 344 deletions.
7 changes: 4 additions & 3 deletions packages/emp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,24 @@
},
"author": "Ken",
"dependencies": {
"@babel/core": "^7.16.0",
"@babel/core": "^7.16.0",
"@babel/plugin-proposal-class-properties": "^7.16.0",
"@babel/plugin-proposal-decorators": "^7.16.0",
"@babel/plugin-syntax-top-level-await": "^7.14.5",
"@babel/plugin-transform-runtime": "^7.16.0",
"@babel/plugin-transform-typescript": "^7.16.8",
"@babel/preset-env": "^7.16.0",
"@babel/preset-react": "^7.16.0",
"@babel/preset-typescript": "^7.16.0",
"@babel/runtime": "^7.16.3",
"babel-loader": "^8.2.3",
"babel-plugin-import": "^1.13.3",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.3",
"@svgr/webpack": "^5.5.0",
"@swc/core": "^1.2.171",
"@types/node": "^16.11.9",
"address": "^1.1.2",
"axios": "^0.21.4",
"babel-loader": "^8.2.3",
"babel-plugin-import": "^1.13.3",
"chalk": "^4.1.2",
"commander": "^8.3.0",
"compression": "^1.7.4",
Expand Down
1 change: 1 addition & 0 deletions packages/emp/src/webpack/loader/babel-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const babelLoader = () => {
],
[require.resolve('@babel/plugin-proposal-decorators'), {legacy: true}],
[require.resolve('@babel/plugin-proposal-class-properties'), {loose: true}],
[require.resolve('@babel/plugin-transform-typescript'), {onlyRemoveTypeImports: true}],
],
},
}
Expand Down
Loading

0 comments on commit 9663108

Please sign in to comment.