chore: 路径别名
This commit is contained in:
parent
f600209445
commit
048aed5408
@ -11,6 +11,7 @@
|
|||||||
"vue": "^3.2.33"
|
"vue": "^3.2.33"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/node": "^17.0.25",
|
||||||
"@vitejs/plugin-vue": "^2.3.1",
|
"@vitejs/plugin-vue": "^2.3.1",
|
||||||
"typescript": "^4.6.3",
|
"typescript": "^4.6.3",
|
||||||
"vite": "^2.9.5",
|
"vite": "^2.9.5",
|
||||||
|
6
pnpm-lock.yaml
generated
6
pnpm-lock.yaml
generated
@ -1,6 +1,7 @@
|
|||||||
lockfileVersion: 5.3
|
lockfileVersion: 5.3
|
||||||
|
|
||||||
specifiers:
|
specifiers:
|
||||||
|
'@types/node': ^17.0.25
|
||||||
'@vitejs/plugin-vue': ^2.3.1
|
'@vitejs/plugin-vue': ^2.3.1
|
||||||
typescript: ^4.6.3
|
typescript: ^4.6.3
|
||||||
vite: ^2.9.5
|
vite: ^2.9.5
|
||||||
@ -11,6 +12,7 @@ dependencies:
|
|||||||
vue: 3.2.33
|
vue: 3.2.33
|
||||||
|
|
||||||
devDependencies:
|
devDependencies:
|
||||||
|
'@types/node': 17.0.25
|
||||||
'@vitejs/plugin-vue': 2.3.1_vite@2.9.5+vue@3.2.33
|
'@vitejs/plugin-vue': 2.3.1_vite@2.9.5+vue@3.2.33
|
||||||
typescript: 4.6.3
|
typescript: 4.6.3
|
||||||
vite: 2.9.5
|
vite: 2.9.5
|
||||||
@ -23,6 +25,10 @@ packages:
|
|||||||
engines: {node: '>=6.0.0'}
|
engines: {node: '>=6.0.0'}
|
||||||
hasBin: true
|
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:
|
/@vitejs/plugin-vue/2.3.1_vite@2.9.5+vue@3.2.33:
|
||||||
resolution: {integrity: sha512-YNzBt8+jt6bSwpt7LP890U1UcTOIZZxfpE5WOJ638PNxSEKOqAi0+FSKS0nVeukfdZ0Ai/H7AFd6k3hayfGZqQ==}
|
resolution: {integrity: sha512-YNzBt8+jt6bSwpt7LP890U1UcTOIZZxfpE5WOJ638PNxSEKOqAi0+FSKS0nVeukfdZ0Ai/H7AFd6k3hayfGZqQ==}
|
||||||
engines: {node: '>=12.0.0'}
|
engines: {node: '>=12.0.0'}
|
||||||
|
@ -17,7 +17,13 @@
|
|||||||
"dom"
|
"dom"
|
||||||
],
|
],
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"types": ["vite/client"]
|
"types": ["vite/client"],
|
||||||
|
/** baseUrl 用来告诉编译器到哪里去查找模块,使用非相对模块时必须配置此项 */
|
||||||
|
"baseUrl": ".",
|
||||||
|
// 非相对模块导入的路径映射配置,根据 baseUrl 配置进行路径计算
|
||||||
|
"paths": {
|
||||||
|
"@/*": ["src/*"]
|
||||||
|
},
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*.ts",
|
"src/**/*.ts",
|
||||||
|
@ -1,7 +1,16 @@
|
|||||||
import { defineConfig } from 'vite'
|
import { ConfigEnv, UserConfigExport } from "vite"
|
||||||
import vue from '@vitejs/plugin-vue'
|
import { resolve } from "path"
|
||||||
|
import vue from "@vitejs/plugin-vue"
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
/** 配置项文档:https://vitejs.dev/config */
|
||||||
export default defineConfig({
|
export default (env: ConfigEnv): UserConfigExport => {
|
||||||
plugins: [vue()]
|
return {
|
||||||
})
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
/** @ 符号指向 src 目录 */
|
||||||
|
"@": resolve(__dirname, "./src"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
plugins: [vue()],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user