-
Notifications
You must be signed in to change notification settings - Fork 613
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
Webpack isn't treeshaking library bundles #2251
Comments
/kind bug |
I believe this is specific to the kubevirt plugin, likely kubevirt-web-ui-components. All of the PF3 components drop out of the main vendor bundle when disabling the kubevirt plugin. Current master: With kubevirt plugin disabled: |
@dgutride fyi |
@mareklibra fyi |
Correct, it is due to |
@spadgett @redallen @mareklibra @jelkosz
This ^^ dependency was added due to migrating code from kubevirt/web-ui fork to Console monorepo, impacting following packages:
After 4.2 gets released and As a result, any |
@spadgett: Closing this issue. |
With only [babel-loader] pointed at an
entry: index.js
, Webpack will treeshake harmony imports likeimport { Button } from 'patternfly-react';
and not include the entirety of thepatternfly-react
project in it's bundle like it is currently:As a few examples,
patternfly-react
's Wizard is included, along with@patternfly/react-core
's Text component.Really, we should expect a bundle more like:
That doesn't include these components.
This will require removing the two
require('patternfly-react').then(m => m.Component)
in the project as well, since that forces Webpack to bundle the entire module.The text was updated successfully, but these errors were encountered: