Closed profispojka closed 1 year ago
When I created git submodule, I tried to use this plugin to correctly resolve paths of the submodule. But unfortunately I am getting this error:
All the paths, but the submodule paths, seems to be resolving correctly.
My vite config (main project):
import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import vuetify from '@vuetify/vite-plugin' import { vueAndTsChecker } from 'vite-plugin-typescript-vue-checker'; import tsconfigPaths from 'vite-tsconfig-paths' // eslint-disable-next-line export default defineConfig({ plugins: [ vue(), // https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vite-plugin vuetify({ autoImport: true }), vueAndTsChecker(), tsconfigPaths({ projects: [ './tsconfig.json', './submodule/lil-mole/tsconfig.json' ] }), ], })
ts config (main project):
{ "compilerOptions": { "target": "esnext", "module": "esnext", "strict": true, "jsx": "preserve", "importHelpers": true, "moduleResolution": "node", "esModuleInterop": true, "resolveJsonModule": true, "allowSyntheticDefaultImports": true, "sourceMap": true, "baseUrl": ".", "types": ["cypress", "node"], "paths": { "@/*": [ "src/*" ] }, "lib": [ "esnext", "dom", "dom.iterable", "scripthost" ] }, "include": [ "src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "cypress/**/*.ts", "cypress/**/*.tsx" ], "exclude": [ "node_modules" ], "rootDirs": ["src/", "submodule/lil-mole/"] }
ts config (submodule):
{ "compilerOptions": { "target": "esnext", "module": "esnext", "strict": true, "jsx": "preserve", "importHelpers": true, "moduleResolution": "node", "esModuleInterop": true, "resolveJsonModule": true, "allowSyntheticDefaultImports": true, "sourceMap": true, "baseUrl": ".", "types": ["cypress"], "paths": { "@/*": [ "src/*" ] }, "lib": [ "esnext", "dom", "dom.iterable", "scripthost" ] }, "include": [ "src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "cypress/**/*.ts", "cypress/**/*.tsx" ], "exclude": [ "node_modules" ] }
Have you tried the loose: true option?
loose: true
Tried it. Unfortunately does not seem to be working.
Can you reproduce this in the ./demo folder please 👍
./demo
When I created git submodule, I tried to use this plugin to correctly resolve paths of the submodule. But unfortunately I am getting this error:
All the paths, but the submodule paths, seems to be resolving correctly.
My vite config (main project):
ts config (main project):
ts config (submodule):