Closed ylc395 closed 2 years ago
Can you reproduce in a git repo and share it please
or fork this repo and update ./demo
with the reproduction (then open a PR)
It's an issue with .vue
importers missing their .ts
query string for <script lang="ts">
blocks, so it's not related to your project structure.
For now, you can work around it with loose: true
option.
my project directory structure is like above. Here is my
vite.config.ts
:and
compilerOptions.paths
intsconfig.json
is like this:in
index.vue
,import domain/service/service1
not work, since browser reportin console.
It seems that vite thought
domain/service/service1
is an external module. I inserted anconsole.log(id)
innode_modules/vite-tsconfig-paths/dist/index.js
andDEBUG=vite-tsconfig-paths yarn vite
, this is output:This shows that some
import
statements were handled correctly but some were not.