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: turn on babel cache & use babel for TS building #3315
Conversation
this helps in rebuilding in dev-server
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 seems good to me. We still have a workflow that runs tsc
as well, so I'm not worried about losing testing here.
tsconfig.base.json
Outdated
// Thanks to babel-loader, we don't need to set it as ES2019. | ||
// But we need to set it as ES2020 to ensure mocha can run correctly. | ||
"target": "ES2020", | ||
"module": "ESNext", |
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.
What do you get out of ESNext
? Mostly wondering why you're adjusting this one as well.
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.
Currently esnext
and es2020
is the same, you mean better to keep it remained?
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, I see. Yeah, I was mostly wondering why you were changing it here. I think I'd rather stick to ES2020 and then change it explicitly when we change it.
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.
Okay, done.
This was broken in #3315 when the config files were split up. Even though babel is used with webpack, babel is not used for the triggers branch which is referenced directly by users who are writing their own triggers.
This was broken in #3315 when the config files were split up. Even though babel is used with webpack, babel is not used for the triggers branch which is referenced directly by users who are writing their own triggers.
It is helpful to enable babel cache when in rebuilding (e.g. running webpack-dev-server), which would significantly decrease the building time.
Although
ts-loader
(tsc
inside) andbabel-loader
(babel
inside) would basically do the same thing in TypeScript transform,babel-loader
removes type notations only, and doesn't do the type-checking things, so it would be faster thants-loader
(even withtranspileOnly
flag) in most cases. Additionally, we now needbabel-loader
to ensure code available always in Chrome v75 of current CEF, so why not combine them in one loader?Nowadays we are using
fork-ts-checker-webpack-plugin
for type checking, which runstsc
in a separated process and report errors asynchronously (in production mode), that would not block webpack building (thatts-loader
will).