Template
1
0
mirror of https://github.com/un-pany/v3-admin-vite.git synced 2025-04-21 11:29:20 +08:00

chore: 路径别名

This commit is contained in:
pany 2022-04-21 00:50:12 +08:00
parent f600209445
commit 048aed5408
4 changed files with 29 additions and 7 deletions

View File

@ -11,6 +11,7 @@
"vue": "^3.2.33"
},
"devDependencies": {
"@types/node": "^17.0.25",
"@vitejs/plugin-vue": "^2.3.1",
"typescript": "^4.6.3",
"vite": "^2.9.5",

6
pnpm-lock.yaml generated
View File

@ -1,6 +1,7 @@
lockfileVersion: 5.3
specifiers:
'@types/node': ^17.0.25
'@vitejs/plugin-vue': ^2.3.1
typescript: ^4.6.3
vite: ^2.9.5
@ -11,6 +12,7 @@ dependencies:
vue: 3.2.33
devDependencies:
'@types/node': 17.0.25
'@vitejs/plugin-vue': 2.3.1_vite@2.9.5+vue@3.2.33
typescript: 4.6.3
vite: 2.9.5
@ -23,6 +25,10 @@ packages:
engines: {node: '>=6.0.0'}
hasBin: true
/@types/node/17.0.25:
resolution: {integrity: sha512-wANk6fBrUwdpY4isjWrKTufkrXdu1D2YHCot2fD/DfWxF5sMrVSA+KN7ydckvaTCh0HiqX9IVl0L5/ZoXg5M7w==}
dev: true
/@vitejs/plugin-vue/2.3.1_vite@2.9.5+vue@3.2.33:
resolution: {integrity: sha512-YNzBt8+jt6bSwpt7LP890U1UcTOIZZxfpE5WOJ638PNxSEKOqAi0+FSKS0nVeukfdZ0Ai/H7AFd6k3hayfGZqQ==}
engines: {node: '>=12.0.0'}

View File

@ -17,7 +17,13 @@
"dom"
],
"skipLibCheck": true,
"types": ["vite/client"]
"types": ["vite/client"],
/** baseUrl 使 */
"baseUrl": ".",
// baseUrl
"paths": {
"@/*": ["src/*"]
},
},
"include": [
"src/**/*.ts",

View File

@ -1,7 +1,16 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { ConfigEnv, UserConfigExport } from "vite"
import { resolve } from "path"
import vue from "@vitejs/plugin-vue"
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()]
})
/** 配置项文档https://vitejs.dev/config */
export default (env: ConfigEnv): UserConfigExport => {
return {
resolve: {
alias: {
/** @ 符号指向 src 目录 */
"@": resolve(__dirname, "./src"),
},
},
plugins: [vue()],
}
}