Skip to content

Commit

Permalink
build: 使用 babel-plugin-import 减少打包体积 (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
vagusX authored Jul 24, 2023
1 parent 08d1622 commit 28f4d19
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ module.exports = {
'@babel/preset-react',
],
plugins: [
['import', [{ libraryName: 'antd', style: true, }]],
'@babel/plugin-transform-runtime',
'@babel/plugin-proposal-optional-chaining',
[
'@babel/plugin-proposal-decorators',
{ legacy: true },
],
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-class-properties'
],
};
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"semver-compare": "^1.0.0",
"slate": "^0.63.0",
"slate-history": "^0.62.0",
"slate-hyperscript": "^0.62.0",
Expand All @@ -68,6 +69,7 @@
"@types/webpack": "^5.28.1",
"@types/webpack-env": "^1.18.0",
"babel-loader": "^8.0.6",
"babel-plugin-import": "^1.13.6",
"chai": "^4.1.0",
"clean-webpack-plugin": "3.0.0",
"copy-webpack-plugin": "6",
Expand Down

0 comments on commit 28f4d19

Please sign in to comment.