Skip to main content

@remotion/codemodsv4.0.527

Apply source-to-source transforms to an in-memory Remotion project.

warning

Draft API: This API is not yet stable. We are in the experimental phase of this package and reserve to change it at any time.

The package accepts a record of file paths and source code and returns a new project together with the files that changed. It does not read from or write to the filesystem, so it can run in browsers and server-side JavaScript runtimes.

Installation

npx remotion add @remotion/codemods

Keep the version aligned with the other Remotion packages in the project.

Project model

A codemod project contains a rootDir and a files record. File paths may be project-relative or absolute, but they must consistently identify imports within the project.

project.ts
import type {CodemodProject} from '@remotion/codemods'; export const project: CodemodProject = { rootDir: '/', files: { 'src/Root.tsx': `export const Root = () => null;`, }, };

Compatibility

BrowsersServersEnvironments
Chrome
Firefox
Safari
Node.js
Bun
Serverless Functions