1 tsconfig.json path属性中新增自定义别名的路径 文件中默认配置了src路径的别名@
"paths": {
"my-service/*": [
"src/service/my/*"
],
"@/*": [
"src/*"
]
},
function resolvePath(...dir) {
return path.join(__dirname, ...dir)
}
module.exports = defineConfig({
chainWebpack: config => {
config.resolve.alias
.set("my-service", resolvePath("src/service/my"))
}
})