现在可以使用@views来指代/src/views文件夹了,src下的所有其他文件夹和public文件夹同理。同时@被用于指代src

This commit is contained in:
高子兴 2024-06-30 01:32:52 +08:00
parent 7f0a92c91b
commit 46c78bfdbf

View File

@ -1,7 +1,20 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
'@assets': path.resolve(__dirname, 'src/assets'),
'@public': path.resolve(__dirname, 'public'),
'@components': path.resolve(__dirname, 'src/components'),
'@views': path.resolve(__dirname, 'src/views'),
'@store': path.resolve(__dirname, 'src/store'),
'@router': path.resolve(__dirname, 'src/router'),
'@services': path.resolve(__dirname, 'src/services'),
}
}
})