You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
common components should be extracted to a separate vendor file instead of being included in multiple bundle files.
What is actually happening?
Code duplication across multiple bundles when code-splitting with webpack
Using create-react-app, react-app-rewired, and babel-plugin-import to call components like:
import { Button } from "antd"
This works great in development however when analyzing the bundle I am seeing that the antd components are being duplicated across multiple bundles. Is this expected behavior and what steps need to be taken to prevent this duplication?
My ideal end goal would be to have these commonly used components in some sort of 'vendor' bundle to prevent the same code from being downloaded more than once.
The photo helps little, and I think it's usage question of webpack than an issue of antd. If you can provide a minimal reproduction repo and ensure it's an issue of antd, let me know and I'll reopen this issue, thanks.
Same issue happens to me. I tried using style: "css" and style: true but full antd gets included into the chunks. @schester44 have you been successful in resolving this?
I wish. I've spent hours playing with CommonsChunkPlugin config options and what not. I still haven't figured it out. A little help from the ant.design team would be awesome!
Version
3.3.3
Environment
OSX, Chrome
Reproduction link
https://i.imgur.com/brKcdWk.png
Steps to reproduce
What is expected?
common components should be extracted to a separate vendor file instead of being included in multiple bundle files.
What is actually happening?
Code duplication across multiple bundles when code-splitting with webpack
Using create-react-app, react-app-rewired, and babel-plugin-import to call components like:
import { Button } from "antd"
This works great in development however when analyzing the bundle I am seeing that the antd components are being duplicated across multiple bundles. Is this expected behavior and what steps need to be taken to prevent this duplication?
My ideal end goal would be to have these commonly used components in some sort of 'vendor' bundle to prevent the same code from being downloaded more than once.
Here is a link to the analyzer photo: https://i.imgur.com/brKcdWk.png
my config-overrides:
The text was updated successfully, but these errors were encountered: