Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use it as external in webpack? #14

Closed
iugo opened this issue Sep 7, 2018 · 5 comments
Closed

How to use it as external in webpack? #14

iugo opened this issue Sep 7, 2018 · 5 comments

Comments

@iugo
Copy link

iugo commented Sep 7, 2018

I use antd as external in webpack. When antd version to v3.9.x, the main bundle size be added 700+kb.

Through webpack-bundle-analyzer, I found that the bundle grows caused by @ant-design/icons.

Want use the https://unpkg.com/@ant-design/icons@1.0.3 CDN.

@HeskeyBaozi
Copy link
Contributor

HeskeyBaozi commented Sep 7, 2018

Use umd.js in https://unpkg.com/@ant-design/icons@next/lib/
it export all icons as variable AntDesignIcons.

Notice

it is not released, use it in antd@3.9.2 or later. antd@3.9.1 doesn't work

@iugo
Copy link
Author

iugo commented Oct 17, 2018

@HeskeyBaozi antd@3.10.0 doesn't work.

webpack.externals: {
  antd: 'antd',
  bizcharts: 'BizCharts',
  '@ant-design/icons': 'AntDesignIcons',
},

According to BundleAnalyzerPlugin analysis, '@ant-design/icons' still be packaged.

@ZhenlyChen
Copy link

I had a same problem.
How to use externals instead of '@ant-design/icons

@iifksp
Copy link

iifksp commented Feb 1, 2019

遇到同样的问题,就算只用一个Input,即使在wepack externals设置了antd,也会一下就把icon都打包进来了。

@sushree-yai
Copy link

How was this resolved? Can someone help pls? I am on antd 4 and creating a component library out of antd. Even if I add it to externals in webpack, I am still seeing a lot of related code in bundle like antdesign icons and rc- stuff. Can someone help pls @afc163

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants