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

Normalize core-js entry points #9752

Merged
merged 3 commits into from Mar 24, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -21,6 +21,9 @@ function isBabelPolyfillSource(source) {
}

function isCoreJSSource(source) {
if (typeof source === "string") {
source = source.replace(/(\/(index)?)?(\.js)?$/i, "").toLowerCase();
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we should use i and toLoweCase, otherwise imports that work when transpiled stop working if they are left as-is.

Copy link
Member Author

Choose a reason for hiding this comment

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

What do you mean?
image

Copy link
Member

Choose a reason for hiding this comment

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

Not on every OS:

Schermata da 2019-03-23 11-28-01

Copy link
Member

Choose a reason for hiding this comment

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

Mh maybe it is ok to normalize paths; it won't cause any bug.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't care, it's not something principal for me.

zloirock marked this conversation as resolved.
Show resolved Hide resolved
}
return has(corejsEntries, source) && corejsEntries[source];
}

Expand Down
@@ -0,0 +1,5 @@
import 'core-js/es/map/index.js';
import 'core-js/es/set/index';
import 'core-js/es/array/from.js';
import 'core-js/es/promise/';
import 'foo/index.js';
@@ -0,0 +1,12 @@
{
"presets": [
[
"../../../../lib",
{
"modules": false,
"useBuiltIns": "entry",
"corejs": 3
}
]
]
}
@@ -0,0 +1,9 @@
import "core-js/modules/es.array.from";
import "core-js/modules/es.map";
import "core-js/modules/es.object.to-string";
import "core-js/modules/es.promise";
import "core-js/modules/es.promise.finally";
import "core-js/modules/es.set";
import "core-js/modules/es.string.iterator";
import "core-js/modules/web.dom-collections.iterator";
import 'foo/index.js';