Open andyrichardson opened 2 years ago
Latest commit: 7f3591069ee2b710ecce15f85f8d4b0aa2b288f5
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
I'm thinking we can just alter emitDeclaration
to check for tsconfig.compilerOptions.declaration
too (and accordingly change the condition for adding declarationDir
to emitDeclaration
)
Check options.generateTypes
then tsconfig.compilerOptions.declaration
and finally !!(pkg.types || pkg.typings)
. That should cover all the bases
Edit: The case of extends
might be something that's acceptable to skip over for now. Mono-repo support (which is where I imagine the need for extending most often comes from) is already pretty limited by rpt2, making Microbundle not the best tool to use if that's the need.
About
Given the following tsconfig
The user will see this message whenever building
This PR introduces a check to only provide a
declarationDir
option to rollup if declarations aren't omitted.Other stuff
This is just a proposal - the
tsconfig.json
would need to be properly interpreted in order to get thedeclaration
value (e.g. to coverextends
).