当前位置:网站首页>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
边栏推荐
- Starting from 1.5, build a microservice framework link tracking traceid
- 有一头母牛,它每年年初生一头小母牛。每头小母牛从第四个年头开始,每年年初也生一头小母牛。请编程实现在第n年的时候,共有多少头母牛?
- Database exception resolution caused by large table delete data deletion
- LeetCode2_ Add two numbers
- Cocos makes Scrollview to realize the effect of zooming in the middle and zooming out on both sides
- webgl_ Enter the three-dimensional world (1)
- Please supervise the 2022 plan
- Jacobo code coverage
- The difference between full-time graduate students and part-time graduate students!
- Streaming end, server end, player end
猜你喜欢
Ida Pro reverse tool finds the IP and port of the socket server
[quick start of Digital IC Verification] 26. Ahb-sramc of SystemVerilog project practice (6) (basic points of APB protocol)
How to create Apple Developer personal account P8 certificate
【數據挖掘】視覺模式挖掘:Hog特征+餘弦相似度/k-means聚類
【數字IC驗證快速入門】20、SystemVerilog學習之基本語法7(覆蓋率驅動...內含實踐練習)
微信小程序 01
The download button and debug button in keil are grayed out
webgl_ Graphic transformation (rotation, translation, zoom)
【数字IC验证快速入门】20、SystemVerilog学习之基本语法7(覆盖率驱动...内含实践练习)
【搞船日记】【Shapr3D的STL格式转Gcode】
随机推荐
有一头母牛,它每年年初生一头小母牛。每头小母牛从第四个年头开始,每年年初也生一头小母牛。请编程实现在第n年的时候,共有多少头母牛?
Super simple and fully automated generation super signature system (cloud Xiaoduo minclouds.com cloud service instance), free application in-house test app distribution and hosting platform, maintenan
使用cpolar建立一个商业网站(2)
Create lib Library in keil and use lib Library
How to create Apple Developer personal account P8 certificate
Write sequence frame animation with shader
Webcodecs parameter settings -avc1.42e01e meaning
Oracle control file loss recovery archive mode method
Configure mongodb database in window environment
Mathematical modeling -- what is mathematical modeling
Cocos creator collision and collision callback do not take effect
Clang compile link ffmpeg FAQ
Please supervise the 2022 plan
[quick start of Digital IC Verification] 25. AHB sramc of SystemVerilog project practice (5) (AHB key review, key points refining)
MySQL bit type resolution
HPDC smart base Talent Development Summit essay
Iterator and for of.. loop
[Data Mining] Visual Pattern Mining: Hog Feature + cosinus Similarity / K - means Clustering
Detailed explanation of unity hot update knowledge points and introduction to common solution principles
The "go to definition" in VS2010 does not respond or prompts the solution of "symbol not found"