Skip to content
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

Fix disappearing polyfills when conflicting versions of preset are used #12554

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -56,7 +56,8 @@ export default function (
modules.length === 1 &&
polyfills.has(modules[0]) &&
available.has(modules[0]) &&
getModulePath(modules[0]) === source
(getModulePath(modules[0]) === source ||
getModulePath(modules[0]) === `${source}.js`)
) {
return false;
}
Expand Down
@@ -1,2 +1,2 @@
import "core-js/modules/es.object.from-entries.js";
import "core-js/modules/esnext.string.replace-all.js";
import 'core-js/modules/es.object.from-entries';
import 'core-js/modules/esnext.string.replace-all';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add test cases when input file contains core-js imports ending with .js?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense 👍 is this single scenario enough or you had more cases in mind?
28f6547

@@ -1,3 +1,3 @@
import "core-js/modules/es.symbol.js";
import "core-js/modules/es.object.from-entries.js";
import "core-js/modules/esnext.string.replace-all.js";
import 'core-js/modules/es.symbol';
import 'core-js/modules/es.object.from-entries';
import 'core-js/modules/esnext.string.replace-all';