-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Option to disable polyfills through babel-preset-env #812
Comments
I think piping the https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/babel-preset-app/index.js#L20 should become useBuiltIns: options.useBuiltIns || 'usage' ...and the option should be documented in README. Then in {
"presets": [
["@vue/app", { "useBuiltIns": false }]
]
} It would also be possible to overwrite the preset-env settings in |
@LinusBorg I like that. I'm wondering if taking it a step further would be even better though, e.g.: {
"presets": [
["@vue/app", { "bundlePolyfills": false }]
]
} This way, the option basically explains itself and users don't have to know about the implementation detail of |
What problem does this feature solve?
The
@vue/app
preset will always bundle any needed polyfills. An alternative to including polyfills via Babel is the polyfill.io service, which will only serve polyfills if the browser actually needs them, thus vastly reducing total bundle size for most visitors.For users that want to use this service, could we provide an option to disable polyfills through babel-preset-env?
What does the proposed API look like?
I see a few solutions:
.babelrc
if that's feasible without potentially breaking with the@vue/app
preset.@vue/app-no-polyfills
.vue.config.js
to disable polyfills.I don't have a strong preference on which of those strategies is used.
The text was updated successfully, but these errors were encountered: