当前位置:网站首页>Vite path alias @ configuration
Vite path alias @ configuration
2022-07-07 15:48:00 【Sam young】
vite.config.ts
Official configuration details
resolve.alias To configure
const path = require('path');
import {
defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
resolve: {
// Configure path alias
alias: {
'@': path.resolve(__dirname, './src'),
},
},
});
tsconfig.json
paths
and baseUrl
{
"compilerOptions": {
"experimentalDecorators": true,
"target": "esnext",
"module": "esnext",
"moduleResolution": "node",
"strict": true,
"jsx": "preserve",
"sourceMap": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"lib": ["esnext", "dom"],
"baseUrl": ".",
"paths": {
"@/*": [
"src/*"
]
},
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
}
Just restart it and use it
边栏推荐
- 【數據挖掘】視覺模式挖掘:Hog特征+餘弦相似度/k-means聚類
- Matlab experience summary
- 【数字IC验证快速入门】22、SystemVerilog项目实践之AHB-SRAMC(2)(AMBA总线介绍)
- Iterator and for of.. loop
- Postman generate timestamp, future timestamp
- Mathematical modeling -- what is mathematical modeling
- 有钱人买房就是不一样
- webgl_ Graphic transformation (rotation, translation, zoom)
- Gd32 F3 pin mapping problem SW interface cannot be burned
- The significance of XOR in embedded C language
猜你喜欢
【微信小程序】Chapter(5):微信小程序基础API接口
MySQL bit type resolution
Window环境下配置Mongodb数据库
Streaming end, server end, player end
写一篇万字长文《CAS自旋锁》送杰伦的新专辑登顶热榜
20th anniversary of agile: a failed uprising
Gd32 F3 pin mapping problem SW interface cannot be burned
【数字IC验证快速入门】18、SystemVerilog学习之基本语法5(并发线程...内含实践练习)
Use of SVN
Configure mongodb database in window environment
随机推荐
[Lanzhou University] information sharing of postgraduate entrance examination and re examination
Oracle control file loss recovery archive mode method
[quick start of Digital IC Verification] 29. Ahb-sramc (9) (ahb-sramc svtb overview) of SystemVerilog project practice
Mesh merging under ue4/ue5 runtime
When opening the system window under UE4 shipping, the problem of crash is attached with the plug-in download address
Whether runnable can be interrupted
Write a ten thousand word long article "CAS spin lock" to send Jay's new album to the top of the hot list
【OBS】RTMPSockBuf_ Fill, remote host closed connection.
【搞船日记】【Shapr3D的STL格式转Gcode】
Cocos creator collision and collision callback do not take effect
摘抄的只言片语
STM32F103C8T6 PWM驱动舵机(SG90)
numpy--数据清洗
如何在opensea批量发布NFT(Rinkeby测试网)
Webcodecs parameter settings -avc1.42e01e meaning
The bank needs to build the middle office capability of the intelligent customer service module to drive the upgrade of the whole scene intelligent customer service
Annexb and avcc are two methods of data segmentation in decoding
[quick start of Digital IC Verification] 18. Basic grammar of SystemVerilog learning 5 (concurrent threads... Including practical exercises)
#HPDC智能基座人才发展峰会随笔
Asynchronous application of generator function