feat(create-vite): tsconfig support vite.config.ts#6324
feat(create-vite): tsconfig support vite.config.ts#6324patak-cat merged 7 commits intovitejs:mainfrom
Conversation
bluwy
left a comment
There was a problem hiding this comment.
I think we can cover template-svelte-ts too. We might've forgot to rename the config to vite.config.ts.
bluwy
left a comment
There was a problem hiding this comment.
LGTM. Might want to fix the typo in the PR title too 👀
|
hahahaha |
jeffydc
left a comment
There was a problem hiding this comment.
I think PR title should be feat(create-vite): ...
|
Hm, I just tried this in my project and if you import something in |
|
you mean is you need to install "@types/node" in the project, and the "@types/node" will make the browser had error type? |
Sorry, I wasn't very clear. Basically if you import another package and that package has a dependency on In the former case, if you don't include |
|
thanks @NMinhNguyen. yes, your editor typescript project will no load the I think only add the vite/client reference in the |
|
Yeah but the thing is that |
|
just add |
That would introduce Node globals in the browser code, right? |
|
no, because |
How? Do you mean |
|
but it can't make the vite.config.ts support module=esnext 😢 |
|
I find the |
|
I haven't tried this but |
|
use tsconfig option |
Interesting! I'm on my phone atm so can't check but will check later tonight |
|
@poyoho I've verified and it seems to work as intended! Great work! |
bluwy
left a comment
There was a problem hiding this comment.
This seems to complicate the setup a bit, but LGTM if it's something the end-user would eventually need to solve.
|
@poyoho we talked about this PR too :) This is a good approach, looks like the vue cli starter will also use the same scheme moving forward. Before merging, it would be good to try to simplify the |
Description
fix #6311
Additional context
Should we distinguish between build and editor configuration files?
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123).