-
Notifications
You must be signed in to change notification settings - Fork 94
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
document - or detect and enable buildMode
automatically
#382
Comments
Ah I see now. The project generated by |
I am still confused, I also use react-ts template, where should I set the |
After adding |
Solution: vite.config.ts file plugins: [
checker({
typescript: { buildMode: true },
}),
] |
If you're starting a new Vite project, the default export default defineConfig({
plugins: [
react(),
checker({
typescript: {
tsconfigPath: './tsconfig.app.json'
},
})
],
}) |
This sucks ass hard, I spend like 3 days trying to figure this out. In the oficial documentation there is no guide that you need to do this. |
buildMode
automatically
This is the solution 👍. Otherwise, vite-plugin-checker won't find the TypeScript configuration. |
It seems that this plugin doesn't yet support tsconfigs that use references. I had to make the same change as the previous comment |
The same problem. The plugin does not see tsconfig files, which are included as references into main tsconfig. Since I have a Vue project and we use vueTsc in addition to tsc, I found a temporary workaround in the form of enable both. For vueTsc, I specified the config for the frontend application (tsconfig.app.json), and for tsc, I specified the config for the server application (tsconfig.node.json). defineConfig({
plugins: [
vue(),
checker({
typescript: {
tsconfigPath: path.resolve(__dirname, 'tsconfig.node.json'),
},
vueTsc: {
tsconfigPath: path.resolve(__dirname, 'tsconfig.app.json'),
},
}),
],
}) I know it's not perfect, but unfortunately, only this method prints all the errors I need, without generating output or *.d.ts artifacts. If you are satisfied with output or *.d.ts artifact generation, you can simply pass |
Describe the bug
After bootstrapping a Vite react-ts project and following vite-plugin-checker's "Getting Started" to set up Typescript checker, the checker seems to execute Typescript, but for some reason it doesn't detect any errors. I.e. running
npm run build
fails due to type errors, butnpm run dev
outputs [TypeScript] Found 0 errors. Watching for file changes.I using WSL on Windows - maybe this is what matters?
Reproduction
npm create vite@latest my-react-app -- --template react-ts
cd my-react-app
npm i vite-plugin-checker -D
typescript: true
src/App.tsx
npm run dev
Expected behavior
Expected result: same error as when executing
npm run build
.Actual result: no errors detected.
System Info
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: