Skip to content

Home > vue-metamorph > transform

transform() function

Runs codemods against source code

Signature:

typescript
export declare function transform(code: string, filename: string, plugins: CodemodPlugin[], opts?: Record<string, any>): TransformResult;

Parameters

Parameter

Type

Description

code

string

Source code

filename

string

The file name, used to determine whether to parse as JS/TS, or as a .vue SFC

plugins

CodemodPlugin[]

List of codemod plugins

opts

Record<string, any>

(Optional) CLI Options

**Returns:**

TransformResult

New source code