Using Typescript Compiler API to rewrite typescript file
typescript, typescript2.0
Solution
Change AST after it was produced by parsing .ts file. Serialize changed AST back to .ts file
Both of these are emitter plugins, you need to add a custom `transformer`. The best docs are still in the PR https://github.com/Microsoft/TypeScript/pull/13940
Problem
I'm trying to work with Typescript Compiler API to create a tool for merging typescript files. I'd like to know is there a way to: - Change AST after it was produced by parsing .ts file. - Serialize changed AST back to .ts file I have read documentation on Compiler API, but it seems to cover only read-only uses-cases of working with AST, while I'm more interesting in modifying source files. Thanks for any help in advance.