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.

Large bundle size - antd in almost every chunk

See original GitHub issue

Running the analyzer for ant-design-pro and inspecting all the chunks separately shows that a lof of the size is antd rebundled with every chunk. this seems to be an issue with babel-plugin-import but I was thinking we can use ant-design-pro as a real project trying to improve size reduction in antd and bundling of antd.

https://i.imgur.com/qkYctS7.png

https://i.imgur.com/B3ub7st.png

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
andriijascommented, Apr 11, 2018

i only have it locally right now but i can showcase when facebook/create-react-app#4077 is merged

@adeelibr it shouldnt be hard to configure manually, basically all you need is

  optimization: {
    minimizer: [
      new OptimizeCSSAssetsPlugin(),
    ],
    // Automatically split vendor and commons
    // https://twitter.com/wSokra/status/969633336732905474
    // https://medium.com/webpack/webpack-4-code-splitting-chunk-graph-and-the-splitchunks-optimization-be739a861366
    splitChunks: {
      chunks: 'all',
      name: false,
    },
    // Keep the runtime chunk seperated to enable long term caching
    // https://twitter.com/wSokra/status/969679223278505985
    runtimeChunk: true,
  },
2reactions
andriijascommented, Mar 31, 2018

its automatically fixed in webpack 4 which supports vendor splitting.

Read more comments on GitHub >

github_iconTop Results From Across the Web

reactjs - ant design - huge imports - Stack Overflow
I am using antd for a small project with only two route. The project size is 1.6MB after uglify. Kindly provide an answer...
Read more >
Ant Design Component Customization and Bundle Optimization
You will also learn how to significantly decrease bundle size, cutting off all the unnecessary modules Ant Design takes there.
Read more >
Ant Design or Elephant Design? - Orkhan Huseynli - Medium
Ant Design with basic setup makes your bundle size nearly 1.5 MB (without ... And the largest file here is main chunk (which...
Read more >
Minimizing Webpack bundle size - Anvil
Webpack works by building a dependency graph of every module imported into our web app, traversing through files containing the code we need, ......
Read more >
How to easily reduce your NextJS bundle size by 30%?
2.08 MB bundle size with source-map-explorer; 656 kB loaded with 1.9 MB resources on network inspector. On top of those numbers, I ran...
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