Skip to content

Path aliases fails to resolve "@/*" #55

Closed Answered by hngngn
dinesh-hills asked this question in Q&A
Discussion options

You must be logged in to vote

you need to update your path in tsconfig.json to "@"

{
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "@/*": ["./src/*"]
    }
  }
}

and add this to your vite.config.ts

resolve: {
  alias: {
    "@": resolve(__dirname, "./src")
  }
}

you can read how to setup manual too.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@dinesh-hills
Comment options

@hngngn
Comment options

Answer selected by dinesh-hills
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants