-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Update Rollup plugins #13265
Update Rollup plugins #13265
Conversation
nicolo-ribaudo
commented
May 5, 2021
•
edited by gitpod-io
bot
Loading
edited by gitpod-io
bot
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 |
@@ -351,6 +351,10 @@ function buildRollup(packages, targetBrowsers) { | |||
"regenerate-unicode-properties" | |||
) + "/**/*.js", | |||
], | |||
// Never delegate to the native require() | |||
ignoreDynamicRequires: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would have caught #12839 earlier
// Never delegate to the native require() | ||
ignoreDynamicRequires: true, | ||
// Align with the Node.js behavior | ||
defaultIsModuleExports: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes it possible to remove a custom plugin from our Babel config, by moving the logic to Rollup itself.
@@ -2,7 +2,7 @@ import syntaxObjectRestSpread from "@babel/plugin-syntax-object-rest-spread"; | |||
|
|||
export default function ({ types: t }) { | |||
return { | |||
inherits: syntaxObjectRestSpread, | |||
inherits: syntaxObjectRestSpread.default, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These syntax plugins are from packages outside of the monorepo which are and will always be CommonJS. With this PR we fully match the Node.js behavior, so we need to add .default
in order to get module.exports
.
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 939e04f:
|
a3bfdd0
to
b18c6f3
Compare
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/45850/ |
b18c6f3
to
939e04f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯