Fix disappearing polyfills when conflicting versions of preset are used #12554
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If the preset-env is applied twice and
The core-js polyfills are removed from the bundle.
Example of breaking configuration can be found in the demo project:
https://github.com/ertrzyiks/babel-loader-lost-polyfills-demo
The demo project uses preset-env and preset-react-app. The minimal configuration causing polyfills to disappear is the following:
Updated snapshots
The two updated snapshots are for cases when the input importing specific files like
so judging by the purpose of the original PR introducing the extensions won't be problematic: the original imports are kept untouched. No autogenerated code without .js extension though.