2016-07-24 55 views
1

我需要添加所產生的文件夾,它是全球性的環境,也不在src既不部分,爲源文件作爲有效名稱空間,如低於電源模塊:包括外src文件夾爲打字稿編譯

root 
|- src 
    |-- component 
     |-- test.model.ts (import { IBuilding } from 'api/interfaces.ts'); 
|- generated 
    |-- api 
     | interfaces.ts (export interface IBuilding {}) 

我看了一下模塊模組分辨率正式文件,但沒有下面的選項見應用於:

  • tsconfig.json - > compilerOptions.paths(路徑映射)
  • tsconfig.json - > compilerOptions.rootDirs(虛擬目錄)
  • tsconfig.json - >包括(文件名模式)

對我來說,這將是非常類似於CLASSPATHPYTHON_PATH分別針對Java和Python。

任何人都可以幫忙嗎?

回答

1

好像你可以做到這一點在你的tsconfig.jsonfilesGlob

"filesGlob": [ 
    "**/*.ts", //Local source, this is the default 
    "../generated/**/*.ts" //generated source 
], //Add as many directories to the above list as needed