如何在angular-cli中为长路径制作“别名”?

前端之家收集整理的这篇文章主要介绍了如何在angular-cli中为长路径制作“别名”?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用Angular CLI.如何转换路径:
import {AppConfig,AppConfigInterface} from '../../../app.config';

类似于:

import {AppConfig,AppConfigInterface} from 'root/app.config';
在tsconfig.json中尝试这个:
{
  "compileOnSave": false,"compilerOptions": {
    "outDir": "./dist/out-tsc","sourceMap": true,"declaration": false,"moduleResolution": "node","emitDecoratorMetadata": true,"experimentalDecorators": true,"target": "es5","typeRoots": [
      "node_modules/@types"
    ],"lib": [
      "es2017","dom"
    ],"paths": {
      "@services/*": ["app/services/*"] // here!
    }
  }
}
原文链接:https://www.f2er.com/angularjs/141401.html

猜你在找的Angularjs相关文章