Article directory
1. Configuration in the vite.config.ts file in the root directory
import {
resolve } from 'path';
resolve: {
// 设置文件./src路径为 @
alias: [
{
find: '@',
replacement: resolve(__dirname, './src')
}
]
}
2. Configuration in the tsconfig.json file in the root directory
//配置 @
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}