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

Rename index.mjs to _index.mjs in @babel/runtime #12855

Merged
merged 2 commits into from Feb 23, 2021

Conversation

nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Feb 23, 2021

Q                       A
Fixed Issues? fix #12854, fix #12853
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

This should fix #12854, but for some reason webpack still loads the .mjs version when using require() 🤔
Maybe it's a caching problem, but what I see locally is that even uses the .mjs version even if I remove every mention of .mjs in @babel/runtime's package.json

The problem is that Webpack 4 always loads index.mjs if there are both index.js and index.mjs, and there is no way (unless you update the webpack config) to tell it to load index.js.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 23, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 00b6291:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration

@nicolo-ribaudo nicolo-ribaudo changed the title Add require condition to @babel/runtime Rename index.mjs to _index.mjs in `@babel/runtime Feb 23, 2021
@nicolo-ribaudo
Copy link
Member Author

I can confirm that this works in my local gatsby project.

@JLHwung JLHwung added the PR: Bug Fix 🐛 A type of pull request used for our changelog categories label Feb 23, 2021
@nicolo-ribaudo nicolo-ribaudo marked this pull request as ready for review February 23, 2021 00:58
@nicolo-ribaudo nicolo-ribaudo changed the title Rename index.mjs to _index.mjs in `@babel/runtime Rename index.mjs to _index.mjs in @babel/runtime Feb 23, 2021
@KyleAMathews
Copy link

Thanks 🙏

@nicolo-ribaudo nicolo-ribaudo merged commit 0c65ff7 into babel:main Feb 23, 2021
@nicolo-ribaudo nicolo-ribaudo deleted the regression-7.13.0-2 branch February 23, 2021 01:08
@nicolo-ribaudo
Copy link
Member Author

@babel-bot
Copy link
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/41949/

@KyleAMathews
Copy link

@nicolo-ribaudo thanks so much! Confirmed Gatsby is back in business with 7.13.1 🎉

@nicolo-ribaudo
Copy link
Member Author

I'm going to sleep now, but tomorrow I'll DM you to see how we can add Gatsby as an e2e test 😬

@KyleAMathews
Copy link

Excellent!

@DSchau
Copy link

DSchau commented Feb 23, 2021

@nicolo-ribaudo thank you truly for the quick turnaround on this.

We at Gatsby appreciate this, and so too do our users. We'd love to chat about e2e test, so let us know how we can help ensure we can automate and track this case for the future 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
None yet
6 participants