-
Notifications
You must be signed in to change notification settings - Fork 360
Remove declaration dir warning when declarations are disabled #912
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
Conversation
⚠️ No Changeset found
Latest commit: 7f35910
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.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
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
{ "compilerOptions": { "declaration": false } }The user will see this message whenever building
This PR introduces a check to only provide a
declarationDiroption to rollup if declarations aren't omitted.Other stuff
This is just a proposal - the
tsconfig.jsonwould need to be properly interpreted in order to get thedeclarationvalue (e.g. to coverextends).