question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Huge bundle size without any explicit use, only of antd

See original GitHub issue

Hi there. In my project I use antd for components and FontAwesome for icons. I never explicitly use icons from Ant Design (Not a single <Icon/> component in my project). Despite that, I can see that in my bundle.js, @ant-design/icons is about 0.5MB (!) in size.

image

In order to optimize antd imports, I use babel-plugin-import as such:

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

But it doesn’t seem to help with reducing the unused icons size taken in my bundle.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:8
  • Comments:6

github_iconTop GitHub Comments

13reactions
itayganorcommented, Jan 14, 2020

Please refer to ant-design/ant-design#12011.

It is all Chinese. It is not possible to refer people to texts they can’t read.

6reactions
hulliscommented, Jan 15, 2020

@itayganor There are some comments in English. You can use some help from those, and Google Translate.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Antd 2.7 mb budle size when i use only 3 components
i used babel-import-plugin and it did reduce bundle size to 2.3 megabytes but in real world it is still not acceptable. import React...
Read more >
Antd adds 546Kb to my app after adding only one Button ...
Just create a brand new React app without anything, ... Try using the webpack bundle analyzer and see where the size comes from....
Read more >
How to Reduce Next.js Bundle Size | NE Digital - Medium
Let's Reduce Javascript Bundle Size · 1) Improve Polyfill · a) Remove explicit core.js import · b) Use feature detection to load polyfill...
Read more >
Bundle splitting with React's lazy & Suspense - De Voorhoede
A guide to using React suspense and lazy loading components. ... We know that the bundle size is large, but how do we...
Read more >
FAQs - styled-components
This is a pretty big release with lots of changes both under the hood and at the ... If you're using the keyframes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found