Skip to content

fix: should not add polyfills from transform-runtime plugin #3730

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

Merged
merged 1 commit into from
Mar 31, 2019

Conversation

haoqunjiang
Copy link
Member

It is due to a misunderstanding when upgrading babel from 7.0.0-beta.47
to 7.x.
In Vue CLI, usage-based polyfills are only added by @babel/preset-env
so that it avoids overheads. transform-runtime plugin adds polyfills
regardless of env targets so we must disable its polyfill feature.
Though, there're edge cases where runtime-helpers' polyfill dependency
are not correctly added (babel/babel#7597),
so we also need to whitelist @babel/runtime for webpack to transpile.

It is due to a misunderstanding when upgrading babel from 7.0.0-beta.47
to 7.x.
In Vue CLI, usage-based polyfills are **only** added by @babel/preset-env
so that it avoids overheads. `transform-runtime` plugin adds polyfills
regardless of env targets so we must disable its polyfill feature.
Though, there're edge cases where runtime-helpers' polyfill dependency
are not correctly added (babel/babel#7597),
so we also need to whitelist `@babel/runtime` for webpack to transpile.
@haoqunjiang haoqunjiang merged commit b987969 into vuejs:dev Mar 31, 2019
haoqunjiang added a commit to haoqunjiang/vue-cli that referenced this pull request Apr 1, 2019
haoqunjiang added a commit that referenced this pull request Apr 1, 2019
haoqunjiang added a commit to haoqunjiang/vue-cli that referenced this pull request Apr 27, 2019
haoqunjiang added a commit that referenced this pull request Apr 28, 2019
The basic idea is the same as #3730, except that this time we use babel-plugin-module-resolve for aliasing instead of relying on webpack.
@aasailan
Copy link

i use vuecli 3.9.2 but the project add polyfills from transform-runtime plugin。what can i do?
2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants