think-typescript-plus
v1.0.3
Published
在原有的think-typescript包的基础上针对@别名做解析
Downloads
2
Maintainers
Readme
think-typescript-plus
在原有的think-typescript包的基础上针对@别名做解析
使用方法
yarn add -D think-typescript-plus
启动文件中引入
const typescript = require('think-typescript-plus');
代码中使用别名@
import { sayHello } from "@/common/service/test/test";
在tsconfig.json中增加path配置
{
"compilerOptions": {
"module": "commonjs",
"target": "ESNext",
"noImplicitAny": true,
"removeComments": true,
"preserveConstEnums": true,
"suppressImplicitAnyIndexErrors": true,
"sourceMap": true,
"esModuleInterop": true,
"outDir": "app",
"baseUrl": ".",
"paths": {
"@/*": [
"src/*"
],
}
},
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules",
"**/*.spec.ts"
]
}