Function: transformSync()
- Exported from:
rolldown/utils - Type: (
filename:string,sourceText:string,options?:TransformOptions|null,cache?:TsconfigCache|null) =>TransformResult - Experimental
Defined in: packages/rolldown/src/utils/transform.ts:100
Transpile a JavaScript or TypeScript into a target ECMAScript version.
Parameters
filename
string
The name of the file being transformed. If this is a relative path, consider setting the TransformOptions#cwd option.
sourceText
string
The source code to transform.
options?
TransformOptions | null
The transform options including tsconfig and inputMap. See TransformOptions for more information.
cache?
TsconfigCache | null
Optional tsconfig cache for reusing resolved tsconfig across multiple transforms. Used when options.tsconfig is true or a path. For a path, construct the cache with the same path.
Returns
an object containing the transformed code, source maps, and any errors that occurred during parsing or transformation.