-
Notifications
You must be signed in to change notification settings - Fork 5
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: add build-adapter command to compile with ESBuild #101
Conversation
8ee0cc9
to
81d4e50
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.
Sorry for the delay, please check my comments for improvements.
if (watch) { | ||
// In watch mode, we start the ESBuild and TSC processes in parallel | ||
// and wait until they end | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars |
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.
Why have the build
variable here if it is not needed?
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 initially had it in use and called stop()
on it, but it seems that esbuild checks for SIGINT itself. Until I'm sure if this is a bug in esbuild or intended, I wanted to leave it in for easy access:
evanw/esbuild#2007
if (watch) { | ||
// In watch mode, we start the ESBuild and TSC processes in parallel | ||
// and wait until they end | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars |
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.
See above
src/build-adapter-handlers.ts
Outdated
// In watch mode, we start the ESBuild and TSC processes in parallel | ||
// and wait until they end | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const { build: buildReact, check: checkReact } = await watchReact(); |
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.
... and again 2x
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, thanks!
This PR adds support for a custom
build
command that uses ESBuild under the hood.Because ESBuild does not do type checking (hence why it is so frigging fast),
tsc
is executed in check mode after each successful build.In addition, there is a watch mode where both ESBuild and tsc are executed in parallel, compiling and checking files whenever they change.