Hello,
I would like to know if it is possible to manipulate AST tree of the file before it is type checked. I know it is possible to get single file AST, manipulate and eventually emit it. I didn't find a way how to add manipulated file to program or manipulate file AST added to rootFiles of the program or manipulate / recheck a file already existing in the cache.
I am trying to create typescript preprocessor and include it to the build progress. As it is not possible to pass map files to typescript compiler any text manipulation would require pre/post processing steps in order to fit the TSC output file/map to the input file (and even this would be hard to achieve).
Only the one way I've found (and working) till now is to allow just simple code removals using //#if, #ifdef, #ifndef, #elseif and replacing removed characters by space character. This allows me to keep map files in sync but it is impossible to implement macros and eventually other features.
Hello,
I would like to know if it is possible to manipulate AST tree of the file before it is type checked. I know it is possible to get single file AST, manipulate and eventually emit it. I didn't find a way how to add manipulated file to program or manipulate file AST added to rootFiles of the program or manipulate / recheck a file already existing in the cache.
I am trying to create typescript preprocessor and include it to the build progress. As it is not possible to pass map files to typescript compiler any text manipulation would require pre/post processing steps in order to fit the TSC output file/map to the input file (and even this would be hard to achieve).
Only the one way I've found (and working) till now is to allow just simple code removals using //#if, #ifdef, #ifndef, #elseif and replacing removed characters by space character. This allows me to keep map files in sync but it is impossible to implement macros and eventually other features.