Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
andyrichardson wants to merge 1 commit into developit:master
base: master
Choose a base branch
Loading
from andyrichardson:patch-1

Conversation

@andyrichardson
Copy link

@andyrichardson andyrichardson commented Nov 25, 2021

About

Given the following tsconfig

{
 "compilerOptions": {
 "declaration": false
 }
}

The user will see this message whenever building

rpt2: options error TS5069: Option 'declarationDir' cannot be specified without specifying option 'declaration' or option 'composite'.

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 the declaration value (e.g. to cover extends).

rschristian reacted with thumbs up emoji
Copy link

changeset-bot bot commented Nov 25, 2021

⚠️ 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

Copy link
Collaborator

rschristian commented Nov 30, 2021
edited
Loading

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /