Skip to content

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

Merged
bluwy merged 1 commit intomainfrom
arnaud/fix-ts-config-2
Jul 31, 2024
Merged

fix(create-vite): avoid usage of composite in TS configs#17774
bluwy merged 1 commit intomainfrom
arnaud/fix-ts-config-2

Conversation

@ArnaudBarre
Copy link
Copy Markdown
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

@bolt-new-by-stackblitz
Copy link
Copy Markdown

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

Copy link
Copy Markdown
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
@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