Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
包括TypeScript编译器的src外部的文件夹_Typescript - Fatal编程技术网

包括TypeScript编译器的src外部的文件夹

包括TypeScript编译器的src外部的文件夹,typescript,Typescript,我需要添加一个生成的文件夹,它既不是全局环境的一部分,也不在src中,以便为源文件提供作为有效名称空间的模块,例如: root |- src |-- component |-- test.model.ts ( import { IBuilding } from 'api/interfaces.ts' ); |- generated |-- api | interfaces.ts ( export interface IBuilding {} ) 我已在官

我需要添加一个生成的文件夹,它既不是全局环境的一部分,也不在
src
中,以便为源文件提供作为有效名称空间的模块,例如:

root
|- src
   |-- component
       |-- test.model.ts ( import { IBuilding } from 'api/interfaces.ts' );
|- generated
   |-- api
       | interfaces.ts ( export interface IBuilding {} )
我已在官方文件中阅读了有关模块模块分辨率的内容,但以下选项均不适用:

  • tsconfig.json->compileoptions.path(路径映射)
  • tsconfig.json->compilerOptions.rootDirs(虚拟目录)
  • tsconfig.json->include(文件名模式)
在我的例子中,它将非常类似于
CLASSPATH
PYTHON\u PATH
分别对Java和PYTHON所做的工作


有人可以帮忙吗?

似乎您可以在
tsconfig.json
中使用
fileglob

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