-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Support jsconfig.json #22
Comments
For now, you can use a all I've found the following {
"compilerOptions": {
// this is implicitly set in a `jsconfig.json` so we have to do it manually here
"allowJs": true,
"outDir": "dist", // this essentially disables the compilation errors by telling vs code where files would be put if it were to compile (which it won't because this isn't a real typescript project)
// Do these as normal to your liking for your project
"baseUrl": "src",
"paths": {
"*": ["src/*"]
}
},
// only treat files in here as js source (thus ignoring `node_modules` and your fake output directory above)
"include": ["src"]
} |
Released in v3.5.0 |
How does this work ? My project use this and it not working as intended :( |
@huyhoang160593 What plugin version are you using? Might be a regression in v4 |
I can confirm it's a v4 regression. We're using |
/cc @MichaelDeBoey you might be interested in adding this to |
@aleclarson I currently don't have the bandwidth to look into that unfortunately |
@aleclarson the thing is that I'm using the version 3.2.5 of vite :(. After debug only the tsconfig.json is load. But even with tsconfig load the path still not working :(. Was using Window 11 is one of the source of the problem :(((( |
It is pity that there is a regression on that. @huyhoang160593 it was working on windows 11 as well for me at least in version 3.6.0 in this exemplary project https://github.com/ibqn/beni-15-puzzle "vite-tsconfig-paths": "^3.6.0" |
It seem like in your |
@huyhoang160593 I use it for global importing i.e. for example import { App } from 'app'
import 'index.css' |
Hello hello! Is there a chance to get the {
"compilerOptions": {
"allowJs": true,
"noEmit": true,
"baseUrl": "src",
"jsx": "react"
},
"include": ["src"]
} Leaving it here maybe someone needs something similar. UPDATE: NVM just realized `tsconfck already supports jsconfig.json since version 3. dominikg/tsconfck#132 Any chance to get that version bump? |
@diego-hourly It's not simply a version bump. Since we use |
tsconfck 3 with its new async cache is a lot faster (60-100 times faster!) than tsconfck 2. So even with a double crawl it would be an improvement. But either way in regular projects users won't notice, there are just not enough files/directories for it to make a difference. The real question is what you would do with the result of a double crawl. Typescript itself uses tsconfig.json by default and you can tell it about jsconfig.json with a cli flag. To my knowledge, its not defined how precedence is handled in a scenario where there are mixed jsconfig.json and tsconfig.json files, so the easy solution here is to follow typescripts lead and make the config name configurable. |
Support for |
Thank you! @aleclarson |
No description provided.
The text was updated successfully, but these errors were encountered: