@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
- Remotion CLI
- npm
- bun
- pnpm
- yarn
npx remotion add @remotion/codemods
This assumes you are currently using v4.0.526 of Remotion.npm i --save-exact @remotion/[email protected]
Also update
remotion and all `@remotion/*` packages to the same version.Remove all
^ character in front of the version numbers of it as it can lead to a version conflict.This assumes you are currently using v4.0.526 of Remotion.pnpm i @remotion/[email protected]
Also update
remotion and all `@remotion/*` packages to the same version.Remove all
^ character in front of the version numbers of it as it can lead to a version conflict.This assumes you are currently using v4.0.526 of Remotion.bun i @remotion/[email protected]
Also update
remotion and all `@remotion/*` packages to the same version.Remove all
^ character in front of the version numbers of it as it can lead to a version conflict.This assumes you are currently using v4.0.526 of Remotion.yarn --exact add @remotion/[email protected]
Also update
remotion and all `@remotion/*` packages to the same version.Remove all
^ character in front of the version numbers of it as it can lead to a version conflict.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.tsimport type {CodemodProject } from '@remotion/codemods'; export constproject :CodemodProject = {rootDir : '/',files : { 'src/Root.tsx': `export const Root = () => null;`, }, };
addSolid()
Add a Solid to a composition source file
deleteJsxNodes()
Delete mounted JSX layers from their source files
Compatibility
| Browsers | Servers | Environments | |||||||
|---|---|---|---|---|---|---|---|---|---|
Chrome | Firefox | Safari | Node.js | Bun | Serverless Functions | ||||