Skip to content

Instantly share code, notes, and snippets.

@irvingvjuarez
Created December 20, 2022 17:50
Show Gist options
  • Save irvingvjuarez/d9832f0e02d89ae0bd3b05eb6070b33d to your computer and use it in GitHub Desktop.
Save irvingvjuarez/d9832f0e02d89ae0bd3b05eb6070b33d to your computer and use it in GitHub Desktop.
How to add path aliases in a vite + ts project
{
"compilerOptions": {
...
"paths": {
"@app/*": ["./src/*"]
}
}
}
// imports...
import * as path from "path"
export default defineConfig({
resolve: {
alias: {
"@app": path.resolve(__dirname, "./src")
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment