🎥 Make videos programmatically with React
Use CommonJS versions during development
Jonny Burgera1f8c17c739f
diff --git a/packages/bundler/package.json b/packages/bundler/package.jsonindex afd1b4cd61..7817edcf2a 100644--- a/packages/bundler/package.json+++ b/packages/bundler/package.json@@ -52,6 +52,22 @@"eslint-plugin-react-hooks": "4.4.0","prettier": "3.1.1","prettier-plugin-organize-imports": "3.2.4",+ "@remotion/gif": "workspace:*",+ "@remotion/google-fonts": "workspace:*",+ "@remotion/layout-utils": "workspace:*",+ "@remotion/lottie": "workspace:*",+ "@remotion/media-utils": "workspace:*",+ "@remotion/motion-blur": "workspace:*",+ "@remotion/noise": "workspace:*",+ "@remotion/paths": "workspace:*",+ "@remotion/player": "workspace:*",+ "@remotion/preload": "workspace:*",+ "@remotion/rive": "workspace:*",+ "@remotion/shapes": "workspace:*",+ "@remotion/skia": "workspace:*",+ "@remotion/three": "workspace:*",+ "@remotion/transitions": "workspace:*",+ "@remotion/zod-types": "workspace:*","react": "18.2.0","react-dom": "18.2.0","vitest": "0.31.1"diff --git a/packages/bundler/src/webpack-config.ts b/packages/bundler/src/webpack-config.tsindex 60f87f83aa..edab3900a7 100644--- a/packages/bundler/src/webpack-config.ts+++ b/packages/bundler/src/webpack-config.ts@@ -79,6 +79,27 @@ export const webpackConfig = async ({bufferStateDelayInMilliseconds,});+ // ES Modules need to be generated with `pnpm build` in every package+ // So if you just make a change while you run `pnpm watch`+ const extraAliases = process.env.USE_COMMON_JS_PKGS+ ? {+ '@remotion/gif': require.resolve('@remotion/gif'),+ '@remotion/layout-utils': require.resolve('@remotion/layout-utils'),+ '@remotion/lottie': require.resolve('@remotion/lottie'),+ '@remotion/media-utils': require.resolve('@remotion/media-utils'),+ '@remotion/motion-blur': require.resolve('@remotion/motion-blur'),+ '@remotion/noise': require.resolve('@remotion/noise'),+ '@remotion/paths': require.resolve('@remotion/paths'),+ '@remotion/player': require.resolve('@remotion/player'),+ '@remotion/preload': require.resolve('@remotion/preload'),+ '@remotion/rive': require.resolve('@remotion/rive'),+ '@remotion/shapes': require.resolve('@remotion/shapes'),+ '@remotion/skia': require.resolve('@remotion/skia'),+ '@remotion/three': require.resolve('@remotion/three'),+ '@remotion/zod-types': require.resolve('@remotion/zod-types'),+ }+ : null;+const conf: WebpackConfiguration = await webpackOverride({optimization: {minimize: false,@@ -153,6 +174,7 @@ export const webpackConfig = async ({// Note: Order matters here! "remotion/no-react" must be matched before "remotion"'remotion/no-react': require.resolve('remotion/no-react'),remotion: require.resolve('remotion'),+ ...extraAliases,},},module: {diff --git a/packages/docs/docs/contributing/index.md b/packages/docs/docs/contributing/index.mdindex 1aef470b68..2ae0e15c06 100644--- a/packages/docs/docs/contributing/index.md+++ b/packages/docs/docs/contributing/index.md@@ -62,16 +62,6 @@ pnpm watch<Step>6</Step> You can start making changes!-## Note about browser packages--Some packages need `pnpm build` in order for their changes to apply.--Packages that are imported in the browser, like `remotion`, `@remotion/player`, `@remotion/gif` have ESM versions. In the Remotion Studio and Next.js, ES Modules are preferred, and they need to build separately. If you don't see changes applied, run:--```sh-cd packages/core && pnpm build-```-## Testing your changesYou can start the Testbed usingdiff --git a/packages/example/package.json b/packages/example/package.jsonindex a768e83fe3..d8f46cd5e7 100644--- a/packages/example/package.json+++ b/packages/example/package.json@@ -11,7 +11,7 @@],"scripts": {"formatting": "prettier src --check",- "start": "remotion studio --props src/my-props.json",+ "start": "USE_COMMON_JS_PKGS=true remotion studio --props src/my-props.json","start-bun": "PATCH_BUN_DEVELOPMENT=true bun --bun remotion studio","start-js": "remotion preview src/entry.jsx","comps": "remotion compositions",diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex a9d74da65b..5eff967db5 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -189,6 +189,54 @@ importers:'@jonny/eslint-config':specifier: 3.0.276version: 3.0.276([email protected])([email protected])+ '@remotion/gif':+ specifier: workspace:*+ version: link:../gif+ '@remotion/google-fonts':+ specifier: workspace:*+ version: link:../google-fonts+ '@remotion/layout-utils':+ specifier: workspace:*+ version: link:../layout-utils+ '@remotion/lottie':+ specifier: workspace:*+ version: link:../lottie+ '@remotion/media-utils':+ specifier: workspace:*+ version: link:../media-utils+ '@remotion/motion-blur':+ specifier: workspace:*+ version: link:../motion-blur+ '@remotion/noise':+ specifier: workspace:*+ version: link:../noise+ '@remotion/paths':+ specifier: workspace:*+ version: link:../paths+ '@remotion/player':+ specifier: workspace:*+ version: link:../player+ '@remotion/preload':+ specifier: workspace:*+ version: link:../preload+ '@remotion/rive':+ specifier: workspace:*+ version: link:../rive+ '@remotion/shapes':+ specifier: workspace:*+ version: link:../shapes+ '@remotion/skia':+ specifier: workspace:*+ version: link:../skia+ '@remotion/three':+ specifier: workspace:*+ version: link:../three+ '@remotion/transitions':+ specifier: workspace:*+ version: link:../transitions+ '@remotion/zod-types':+ specifier: workspace:*+ version: link:../zod-types'@types/node':specifier: 18.14.6version: 18.14.6