Import module from root path in TypeScript

后端 未结 5 1863
隐瞒了意图╮
隐瞒了意图╮ 2021-01-07 23:02

Let\'s suppose I\'ve a project, and its main source directory is:

C:\\product\\src

Based on this directory, every import path would be rela

5条回答
  •  失恋的感觉
    2021-01-07 23:56

    Just for record

    If you want use absolute import from your project, Do not use / as prefix, such as /src/config/cfg, just use as src/config/cfg

    As https://stackoverflow.com/a/46229294/7529562 pointed, / stand for System root,

    tsc will complain cannot find module

提交回复
热议问题