-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat(builder): build plugins with esbuild #2717
Conversation
I decided to make |
Waiting on #2863. |
@@ -0,0 +1,25 @@ | |||
releases: | |||
"@yarnpkg/builder": major | |||
"@yarnpkg/cli": major |
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.
I don't see why the cli needs a release 🤔
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.
I bumped it because updating ESBuild might cause the generated bundle to be different 🤔
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.
Oh yeah, due to esbuild not always including __esModule
anymore it might break plugins that depends on it existing 🤔
LGTM - wdyt, @merceyz? |
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.
I'm a bit worried about #2717 (comment) but otherwise LGTM
What's the problem this PR addresses?
We currently use ESBuild to build the bundle and Webpack to build the plugins.
How did you fix it?
Plugins will now also be built using ESBuild. I kept the dynamic lib magic by creating an inline plugin. I also kept the wrapper by using
banner
andfooter
.Stats for compiling
@yarnpkg/plugin-workspace-tools
:Before:
After:
//prettier-ignore
comment in the wrapper)Note: I think building
plugin-version
might be a bit broken currently because of how@yarnpkg/esbuild-plugin-pnp
handles optional peer deps, but I'll investigate tomorrow after getting some sleep.Checklist