I need to add a generated folder, which is neither part of global ambient nor in the src
, to supply modules for the source files as valid namespaces, such as below:
root
|- src
|-- component
|-- test.model.ts ( import { IBuilding } from 'api/interfaces.ts' );
|- generated
|-- api
| interfaces.ts ( export interface IBuilding {} )
I have read about Modules and Module Resolution in official documentation but none of the options below see to apply:
In my case it would be very much similar to what CLASSPATH
and PYTHON_PATH
do for Java and Python respectively.
Anyone can help?
Seems like you could do this in your tsconfig.json
with a filesGlob
:
"filesGlob": [
"**/*.ts", //Local source, this is the default
"../generated/**/*.ts" //generated source
], //Add as many directories to the above list as needed
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With