Skip to content
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

Cannot resolve paths of submodule. #63

Closed
profispojka opened this issue Aug 7, 2022 · 3 comments
Closed

Cannot resolve paths of submodule. #63

profispojka opened this issue Aug 7, 2022 · 3 comments

Comments

@profispojka
Copy link

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:
image

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"
  ]
}

@aleclarson
Copy link
Owner

Have you tried the loose: true option?

@profispojka
Copy link
Author

Tried it. Unfortunately does not seem to be working.

@aleclarson
Copy link
Owner

Can you reproduce this in the ./demo folder please 👍

@aleclarson aleclarson added the waiting for response The issue author needs to reply label Oct 20, 2022
@aleclarson aleclarson removed the waiting for response The issue author needs to reply label Nov 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants