Using legacy Babel transpilation
Remotion uses faster transpilation by default: esbuild-loader with Webpack and SWC with Rspack.
To use Babel instead, override the bundler configuration. Overrides work reducer-style: You receive the default configuration and return the modified configuration.
The @remotion/babel-loader compatibility package provides replaceLoadersWithBabel() to replace the default JavaScript and TypeScript loaders with Babel.
This should not be necessary in general. We encourage you to report issues with the default transpiler.
Example
- Remotion CLI
- npm
- bun
- pnpm
- yarn
npx remotion add @remotion/babel-loader
This assumes you are currently using v4.0.545 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.545 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.545 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.545 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.remotion.config.tsimport {replaceLoadersWithBabel } from "@remotion/babel-loader";Config .overrideBundlerConfig ((currentConfiguration ) => { returnreplaceLoadersWithBabel (currentConfiguration ); });
When using bundle()
When using the bundle() Node.js API, provide the bundler override directly because Node.js APIs do not read from the config file. To deploy the resulting directory to Lambda, pass it to deploySiteFromBundle().
my-script.jsimport {bundle } from "@remotion/bundler"; import {replaceLoadersWithBabel } from "@remotion/babel-loader"; awaitbundle ({entryPoint :require .resolve ("./src/index.ts"),bundlerOverride : (config ) =>replaceLoadersWithBabel (config ), });