Does Vite work with TS? #12672
-
|
It does start, but I'm keep getting the following errors: |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
|
The aliases are not defined so you will have to use relative imports for now. |
Beta Was this translation helpful? Give feedback.
-
|
@stefanvanherwijnen Could you be more specific please? This is my Does this mean I have to overrule the default given paths? |
Beta Was this translation helpful? Give feedback.
-
|
as pointed out, the Vite alias does work (in my case I use
export default defineConfig({
plugins: [
Vue({ template: { transformAssetUrls }, }),
quasar({ sassVariables: 'src/styles/quasar.scss', }),
],
resolve: {
alias: {
'@/': `${path.resolve(__dirname, 'src')}/`,
},
},
});
{
"compilerOptions": {
// ...
"paths": {
"@/*": ["src/*"]
}
}
}
<script lang="ts">
import Content from '@/Content.vue';
</script> |
Beta Was this translation helpful? Give feedback.
as pointed out, the Vite alias does work (in my case I use
@which is what most people tend to use but you could replace it with any other alias you wish to use)vite.config.tstsconfig.jsonAbout.vue