Skip to content
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

fix(create-vite): avoid usage of composite in TS configs #17774

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

ArnaudBarre
Copy link
Member

@ArnaudBarre ArnaudBarre commented Jul 27, 2024

Fixes #17638

After some investigation, composite is not required when the project by referenced an empty project. Which is why I'm #17732 in favor of this PR.

I've also done two things:

  • Remove resolveJsonModule which is the default in bundler mode.
  • Align the node config to the main one, targeting node 18.

This keeps the issues about needing -b and having silent exit 0 on tsc at the root, I've made a comment here to the TS team about this issue: microsoft/TypeScript#25600 (comment)

Also in TS 5.6, we will need to add tsbuildInfoFile option: https://devblogs.microsoft.com/typescript/announcing-typescript-5-6-beta/#tsbuildinfo-is-always-written.
For now this is an error without incremental or composite.
I'm in favor of adding it with incremental from now, but @dominikg felt like it was too much of an optimization for a starter

Copy link

stackblitz bot commented Jul 27, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM that it fixes that issue. We can still revisit the -b issue requirement again, and personally Sapphi's idea to keep a plain single tsconfig.json is still open for me.

@bluwy bluwy merged commit efcd830 into main Jul 31, 2024
12 checks passed
@bluwy bluwy deleted the arnaud/fix-ts-config-2 branch July 31, 2024 08:19
aentwist added a commit to aentwist/AutoAFK that referenced this pull request Aug 25, 2024
Type checking is currently not evaluated for referenced files. In order
to make it evaluate, we have to use `--build`. However, this cannot be
used with `--noEmit` and so will emit compiled files unless we use the
solution tsconfig pattern.

See
- microsoft/TypeScript#53979
- vitejs/vite#15913

See also
- https://www.typescriptlang.org/docs/handbook/project-references.html#overall-structure
- vitejs/vite#17774
aentwist added a commit to aentwist/AutoAFK that referenced this pull request Aug 25, 2024
Type checking is currently not evaluated for referenced files. In order
to make it evaluate, we have to use `--build`. However, this cannot be
used with `--noEmit` and so will emit compiled files unless we use the
solution tsconfig pattern.

See
- microsoft/TypeScript#53979
- vitejs/vite#15913

See also
- https://www.typescriptlang.org/docs/handbook/project-references.html#overall-structure
- vitejs/vite#17774
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New tsconfig of create-vite gives type errors if .d.ts files can not be generated
4 participants