transform
- Type:
optionaltransform:TransformOptions
Defined in: options/input-options.ts:644
Configure how the code is transformed. This process happens after the transform hook.
Example
Enable legacy decorators
js
export default defineConfig({
transform: {
decorator: {
legacy: true,
},
},
})Note that if you have correct tsconfig.json file, Rolldown will automatically detect and enable legacy decorators support.
In-depth
Rolldown uses Oxc under the hood for transformation.
While Oxc does not support lowering the latest decorators proposal yet, Rolldown is able to bundle them.
See Oxc Transformer's document for more details.