2

is there any way to do "tree shaking" of Antd with React 16.13 (CRA) i tried this tutorial https://www.npmjs.com/package/babel-plugin-import in package.json

"plugins": [
  ["import", { "libraryName": "antd", "style": true}, "antd"]
]

but after build all build files are with the same size. Should I expect anything else? Any advice about three shakings of Antd. Thanks

Nick1R11
  • 51
  • 1
  • 1
  • 7

1 Answers1

0

You should add those 3 lines into .babelrc instead of package.json

And you might want to replace moment.js from antd with dayjs to reduce more bundle size.

Goon Nguyen
  • 1,462
  • 11
  • 26