Skip to content

Commit 5b8628c

Browse files
authored
chore: support for path aliases (#25)
1 parent bf9cfc1 commit 5b8628c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

tsconfig.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@
44
"jsx": "preserve",
55
"lib": ["ES2020", "DOM", "DOM.Iterable"],
66
"useDefineForClassFields": true,
7+
8+
"baseUrl": ".",
79
"module": "ESNext",
810

911
/* Bundler mode */
1012
"moduleResolution": "bundler",
13+
"paths": {
14+
"@/*": ["src/*"]
15+
},
1116
"resolveJsonModule": true,
1217
"allowImportingTsExtensions": true,
1318

@@ -19,6 +24,7 @@
1924
"noEmit": true,
2025
"isolatedModules": true,
2126
"skipLibCheck": true
27+
2228
},
2329
"references": [{ "path": "./tsconfig.node.json" }],
2430
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]

vite.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { resolve } from 'node:path'
12
import { env } from 'node:process'
23

34
import vue from '@vitejs/plugin-vue'
@@ -11,7 +12,7 @@ export default defineConfig(async () => ({
1112
plugins: [vue(), UnoCSS()],
1213
resolve: {
1314
alias: {
14-
'@': '/src',
15+
'@': resolve(__dirname, 'src'),
1516
},
1617
},
1718
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`

0 commit comments

Comments
 (0)