All methods accept Handler, which is a storage for errors.
The caller should check if the handler contains any errors after calling method.
These are low-level apis.
op in current compiler’s context.
Note: Other methods of
Compiler already uses this internally.
Converts ast node to source string and sourcemap.
This method receives target file path, but does not write file to the path. See: https://github.com/swc-project/swc/issues/1255
This method returns None if a file should be skipped.
This method handles merging of config.
This method does not parse module.
custom_after_pass is applied after swc transforms are applied.
program: If you already parsed
Program, you can pass it.
- Handling decorators, if configured
- Stripping typescript nodes
This means, you can use
noop_visit_mut_type in your visitor to reduce the binary size.
You can use custom pass with this method.
There exists a PassBuilder to help building custom passes.
Returns the argument unchanged.