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

Make sure that Rollup's dynamicRequireTargets are included #12839

Conversation

nicolo-ribaudo
Copy link
Member

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

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

This is a follow-up to #12819: that PR was going in the good direction, but it didn't actually fix the issue: Rollup wasn't injecting the dynamicRequireTargets anywhere, and we didn't notice it because apparently it fallbacks to Node's require() function (which works on CI). You can see it in #12819's repl.

I noticed it when rebasing #12015: that PR needed another dynamicRequireTarget, but it caught the error because it was for a relative path which made Node's resolution algorithm fail.

I particularly dislike this solution, but it's the only thing I could came up with to make it work.

I'd like to include this in the next version, since it's a follow-up to #12819 which has already been merged.

Repl for this PR: https://babeljs.io/repl/build/41352/#?browsers=%3E0.5%25%2C%20not%20ie%2010&build=&builtIns=false&spec=false&loose=false&code_lz=G4QwTgBAHhC8EHoA6AHA3gGQL4IK4G4g&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=false&presets=env&prettier=false&targets=&version=7.12.18%2Bpr.12839&externalPlugins=

@nicolo-ribaudo nicolo-ribaudo added PR: Bug Fix 🐛 A type of pull request used for our changelog categories pkg: standalone labels Feb 21, 2021
@@ -312,7 +314,7 @@ function buildRollup(packages, targetBrowsers) {
"./packages/babel-helper-create-regexp-features-plugin",
"regexpu-core",
"regenerate-unicode-properties"
) + "/../**",
) + "/**/*.js",
Copy link
Member Author

Choose a reason for hiding this comment

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

Without the explicit .js extension it was trying to parse the LICENSE file as JS.

@babel-bot
Copy link
Collaborator

babel-bot commented Feb 21, 2021

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

@nicolo-ribaudo nicolo-ribaudo added PR: Internal 🏠 A type of pull request used for our changelog categories and removed PR: Bug Fix 🐛 A type of pull request used for our changelog categories labels Feb 21, 2021
@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 21, 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 67d3061:

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

Copy link
Contributor

@JLHwung JLHwung left a comment

Choose a reason for hiding this comment

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

Black magic.

Copy link
Member

@existentialism existentialism left a comment

Choose a reason for hiding this comment

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

🪄

This was referenced Mar 12, 2021
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label May 24, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 24, 2021
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 pkg: standalone PR: Internal 🏠 A type of pull request used for our changelog categories Priority: High
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants