现在在tsconfig.json中配置了
{
"compilerOptions": {
"strictNullChecks": true,
"noImplicitAny": true,
"module": "CommonJS",
"target": "ES5",
"allowJs": false,
"experimentalDecorators": true,
"noImplicitThis": true,
"noImplicitReturns": true,
"alwaysStrict": true,
"inlineSourceMap": true,
"inlineSources": true,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"strict": true,
"removeComments": true,
"pretty": true,
"strictPropertyInitialization": true,
"lib": ["es2015", "es2017"],
"baseUrl": "./",
"paths": {
"@/*": ["miniprogram/*"],
"@common/*": ["miniprogram/common/*"],
"@sr": ["miniprogram/supermarket"],
"@sr/*": ["miniprogram/supermarket/*"]
},
"plugins": [{
"transform": "typescript-transform-paths",
"after": true
}],
"importHelpers": true,
"typeRoots": [
"./typings"
]
},
"include": [
"./**/*.ts"
],
"exclude": [
"node_modules"
]
}
但是执行yarn tsc ts中的别名引用没替换 应该怎么实现路径别名呢
参考我回答的这个
https://developers.weixin.qq.com/community/develop/doc/000e26fb024ff8e28b1dc4adf51000
同问,其实就是个阉割版!
同问!我也是用别名无法识别,是不是小程序的bug!