How to force vue-tsc --noEmit to ignore git submodules in Vite?

208 Views Asked by At

I have a Vite project that contains a submodule which is itself also a Vite project. When I run the submodule type-check it passes without problems. But when I run the type-check in the parent project it fails with "Cannot find module 'path/to/submodule'". Both projects run and build without errors.

The error should be easy to reproduce: if you create a basic Vite-Vue3 project and then create a new one inside it as a submodule. When running the type-check command you'll see something like:

module/src/components/__tests__/HelloWorld.spec.ts:4:24 - error TS2307: Cannot find module '../HelloWorld.vue' or its corresponding type declarations.

4 import HelloWorld from '../HelloWorld.vue'

Any idea how to handle this? I'd love to have type-check running in the pipeline of the parent project, but this error won't let me.

0

There are 0 best solutions below