包括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