Skip to content

Commit 1934585

Browse files
author
issayah
committed
Add a simple src/ utility alias with @
1 parent 2e5834e commit 1934585

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"sourceMap": true,
1313
"baseUrl": ".",
1414
"types": ["vitest/globals", "@vuepress/client/types", "vite/client"],
15-
"paths": {},
15+
"paths": {"@/*": ["./src/*"]},
1616
"lib": ["esnext", "dom", "dom.iterable", "scripthost"]
1717
},
1818
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "tests/**/*.ts", "tests/**/*.tsx"],

vite.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ import vue from '@vitejs/plugin-vue'
55
import {resolve} from 'path'
66
import visualizer from 'rollup-plugin-visualizer'
77
import dts from 'vite-plugin-dts'
8+
import {fileURLToPath, URL} from 'url'
89

910
const config = defineConfig({
1011
resolve: {
11-
alias: {},
12+
alias: {
13+
'@': fileURLToPath(new URL('./src', import.meta.url)),
14+
},
1215
},
1316

1417
build: {

0 commit comments

Comments
 (0)