Guide/Generator
Generator
Use generateSync to turn a program AST back into source. Import it from @swc-next/core, the focused @swc-next/generator package, or the initialized browser package.
Print an edited program
Compact output
minify controls printing and whitespace. It does not perform the optimizations described under Minifier. Printing TypeScript also preserves types.
Reference
See the Generator API for AST and metadata inputs, the output shape, and all formatting options. For a complete workflow, start with Parser and Walk.