-
Notifications
You must be signed in to change notification settings - Fork 328
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
Polyfill imports can't be treeshaken #710
Comments
Just realised this is only a problem if using the 'all' entry point. Which currently doesnt allow a destructured import. So will close for now, may re-open if we decide to allow a destructured import. |
We now encourage a destructured import so this is an issue |
Actually, let's focus on ES6 modules tree shaking before this... Will add a comment to that instead. |
8 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When we import polyfills they're global.
Since a build system can't know where they're used, it can't make a decision to include it or not.
You can see an example of this here:
govuk-frontend/src/components/checkboxes/checkboxes.js
Line 1 in de2b8db
A potential solution would be to have a function that polyfills return that can be called.
The text was updated successfully, but these errors were encountered: