What would be the workflow to perform type checking before building? #53
-
QuestionHow would you go about performing type checking before bundling? As I understand, pkgroll only bundles the project to fast plain JS code to be used in production without needing to install TypeScript etc on the production server. However, it does not do any checks before bundling the code. I would like to cancel the compilation in case there are any unseen warnings or errors. My guess would be adding {
"scripts": {
"build": "tsc --noEmit && pkgroll"
}
} I'm not completely sure this is the right call, though. Can this cause some problems if the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yep! That's the expected approach (same as other tools like tsx). If you emit types ( |
Beta Was this translation helpful? Give feedback.
Yep! That's the expected approach (same as other tools like tsx).
If you emit types (
.d.ts
files), it will also do some basic type checking as a result of compiling the types, and error if it can't make sense of it.