K
K
Konstantin2020-01-13 11:17:40
typescript
Konstantin, 2020-01-13 11:17:40

Why doesn't alias work in tsconfig?

Despite the rules in tsconfig on the path in the project - visual code does not see these paths:

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "module": "esnext",
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es2015",
    "typeRoots": ["node_modules/@types"],
    "lib": ["es2018", "dom"],
    "paths": {
      "@common": ["projects/test-lib/src/lib/common/"],
      "test-lib": ["dist/test-lib"],
      "test-lib/*": ["dist/test-lib/*"]
    }

  },
  "angularCompilerOptions": {
    "fullTemplateTypeCheck": true,
    "strictInjectionParameters": true
  }
}

In code I import like this:
import { DOMFunctions } from "@common/DOM-element-functions";

Sees @common and then DOM-element-functions does not see
File:
export namespace DOMFunctions {
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question