chore: support for path aliases (#25)

This commit is contained in:
ayangweb
2025-04-01 09:29:01 +08:00
committed by GitHub
parent bf9cfc128a
commit 5b8628cd39
2 changed files with 8 additions and 1 deletions

View File

@@ -4,10 +4,15 @@
"jsx": "preserve",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"useDefineForClassFields": true,
"baseUrl": ".",
"module": "ESNext",
/* Bundler mode */
"moduleResolution": "bundler",
"paths": {
"@/*": ["src/*"]
},
"resolveJsonModule": true,
"allowImportingTsExtensions": true,
@@ -19,6 +24,7 @@
"noEmit": true,
"isolatedModules": true,
"skipLibCheck": true
},
"references": [{ "path": "./tsconfig.node.json" }],
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]

View File

@@ -1,3 +1,4 @@
import { resolve } from 'node:path'
import { env } from 'node:process'
import vue from '@vitejs/plugin-vue'
@@ -11,7 +12,7 @@ export default defineConfig(async () => ({
plugins: [vue(), UnoCSS()],
resolve: {
alias: {
'@': '/src',
'@': resolve(__dirname, 'src'),
},
},
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`