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

Document how to deal with core-js and regenerator-runtime injection in Yarn PnP #2601

Closed
wants to merge 1 commit into from
Closed

Conversation

wojtekmaj
Copy link

No description provided.

@netlify
Copy link

netlify bot commented Dec 29, 2021

✔️ Deploy Preview for babel ready!
Built without sensitive environment variables

🔨 Explore the source changes: b07b228

🔍 Inspect the deploy log: https://app.netlify.com/sites/babel/deploys/61cc5d601910ba0007fb3c81

😎 Browse the preview: https://deploy-preview-2601--babel.netlify.app

@merceyz
Copy link

merceyz commented Dec 29, 2021

This shouldn't be documented as a PnP specific issue because it isn't one, you can run into the same issue with Yarn using node_modules, pnpm, and npm. See storybookjs/storybook#11255 where it happened when using npm.

@nicolo-ribaudo
Copy link
Member

The preferred solution should be https://babeljs.io/docs/en/babel-plugin-transform-runtime#absoluteruntime, since it doesn't require you to use aliases or change the Yarn configuration.
And, as @merceyz mentioned, it should be used whenever you are compiling your dependencies and want them to reference all the same core-js package.

@wojtekmaj
Copy link
Author

The preferred solution should be https://babeljs.io/docs/en/babel-plugin-transform-runtime#absoluteruntime

This option is not available in @babel/preset-env though. So how users of @babel/preset-env could escape this trap?

@nicolo-ribaudo
Copy link
Member

nicolo-ribaudo commented Dec 29, 2021

By migrating from preset-env to the new https://github.com/babel/babel-polyfills packages, which have the absoluteImports option (https://github.com/babel/babel-polyfills/blob/main/docs/usage.md#absoluteimports) and are already internally used by preset-env.

@wojtekmaj
Copy link
Author

By migrating from preset-env to the new https://github.com/babel/babel-polyfills packages

Would that be a piece of advice you think the docs should mention instead of the one I wrote?

which have the absoluteImports option (https://github.com/babel/babel-polyfills/blob/main/docs/usage.md#absoluteimports) and are already internally used by preset-env.

...or maybe this option could be exposed in preset-env?

@wojtekmaj wojtekmaj closed this Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants