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

create-vite: set incremental: true in tsconfig #19535

Open
4 tasks done
jansepke opened this issue Feb 28, 2025 · 5 comments
Open
4 tasks done

create-vite: set incremental: true in tsconfig #19535

jansepke opened this issue Feb 28, 2025 · 5 comments

Comments

@jansepke
Copy link

Description

as a developer I want fast build times event if running a build locally. typecript offers incremental builds but those are not enabled in new vite projects

Suggested solution

set incremental: true in tsconfig to speed up the tsc part of "build": "tsc -b && vite build"

Alternative

No response

Additional context

No response

Validations

@nayounsang
Copy link

If you guys don't mind, may I contribute to this?

@jansepke
Copy link
Author

jansepke commented Mar 1, 2025

If you guys don't mind, may I contribute to this?

Yes, sure. The question is more if there is any reason for not setting this?

@nayounsang
Copy link

nayounsang commented Mar 1, 2025

@jansepke I don't know. Why? Anyway, incremental builds are pretty sweet. Recently, my project used this and reduced typescript build time by about 2.5 times.

@nayounsang
Copy link

nayounsang commented Mar 1, 2025

Ah, I just experimented and read ts docs, but incremental build is already used.
The reason is because of the -b option.
If set this, incremental builds will be executed even if not specify incremental.
But, some template(vanilla, svelte and lit - it might not be needed some, but I'm not sure.) doesn't use -b option. And If we try to do something using only tsconfig.app.json, incremental builds will not work.

What do you think?
@jansepke

@jansepke
Copy link
Author

Ah, I just experimented and read ts docs, but incremental build is already used. The reason is because of the -b option. If set this, incremental builds will be executed even if not specify incremental.

at least when running time npx tsc -b in a newly created vite project (using npm create vite@latest with React+Typescript+SWC template) I see a big performance gain when using "incremental": true in both tsconfig.app.json and tsconfig.node.json

Without incremental: ~900ms
With incremental after the second run: ~350ms

So I cannot confirm that tsc -b implies "incremental": true and I do also not read this in the Typescript docs

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

No branches or pull requests

3 participants