-
-
Notifications
You must be signed in to change notification settings - Fork 256
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
build: use esbuild plugin #129
Conversation
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 289b7ce:
|
Hi, thanks for your work! Two reasons:
|
Done! I actually think the speed element is the same, but I agree, it's better to have consistent structure between each. |
I hope that esbuild can replace babel macro in the future :) |
babel.config.js
Outdated
@@ -16,6 +16,7 @@ module.exports = (api, targets) => { | |||
], | |||
], | |||
plugins: [ | |||
'@babel/plugin-transform-runtime', |
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.
we don't need this?
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 might be wrong, but I think we do -> pmndrs/jotai#378 (comment)
I set this as I wanted to get rid of the warning when bundling.
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.
LGTM
Hi there!
I made a PR for jotai a few days ago updating the build tooling to use esbuild as the typescript transpiler and @dai-shi requested I make PRs for zustand and valtio, so here we are! The main reason for this change is because of how much faster esbuild is at compiling javascript from typescript:
Before
✨ Done in 24.54s.
After
✨ Done in 9.38s.
There are also some very minor bundle size changes with this update.
General overview of changes
esbuild
androllup-plugin-esbuild
typescript
plugin increateESMConfig
andcreateCommonJSConfig
to use esbuildid.includes('@babel/runtime')
to the externals check per this recommendationtslib
as a dev dependency due to it being missing for the typescript plugin