Skip to content

🎥 Make videos programmatically with React

works :tada:

Jonny Burgeraaf8a9d0d5fb
diff --git a/packages/bundler/package.json b/packages/bundler/package.json
index 0c78f63069..339b372ddc 100644
--- a/packages/bundler/package.json
+++ b/packages/bundler/package.json
@@ -20,6 +20,7 @@
"files": [
"dist",
"react-shim.js",
+ "renderEntry.tsx",
"favicon.ico"
],
"author": "Jonny Burger <[email protected]>",
diff --git a/packages/bundler/src/renderEntry.tsx b/packages/bundler/renderEntry.tsx
similarity index 98%
rename from packages/bundler/src/renderEntry.tsx
rename to packages/bundler/renderEntry.tsx
index c1dd4a7ac1..32ef0d5621 100644
--- a/packages/bundler/src/renderEntry.tsx
+++ b/packages/bundler/renderEntry.tsx
@@ -1,3 +1,6 @@
+// This file is not compiled by Typescript, but by ESBuild
+// to keep the dynamic import
+
import React, {useContext, useEffect, useRef, useState} from 'react';
import type {render} from 'react-dom';
// In React 18, you should use createRoot() from "react-dom/client".
@@ -11,15 +14,15 @@ import type {
VideoConfigWithSerializedProps,
} from 'remotion';
import {
+ Internals,
+ VERSION,
continueRender,
delayRender,
getInputProps,
getRemotionEnvironment,
- Internals,
- VERSION,
} from 'remotion';
import {NoReactInternals} from 'remotion/no-react';
-import {getBundleMode, setBundleMode} from './bundle-mode';
+import {getBundleMode, setBundleMode} from './src/bundle-mode';
Internals.CSSUtils.injectCSS(
Internals.CSSUtils.makeDefaultCSS(null, '#1f2428'),
diff --git a/packages/bundler/src/bundle.ts b/packages/bundler/src/bundle.ts
index f411f576b4..276d821156 100644
--- a/packages/bundler/src/bundle.ts
+++ b/packages/bundler/src/bundle.ts
@@ -63,7 +63,7 @@ export const getConfig = ({
onProgress?: (progress: number) => void;
options?: LegacyBundleOptions;
}) => {
- const entry = require.resolve('./renderEntry');
+ const entry = path.resolve(__dirname, '..', './renderEntry.tsx');
return webpackConfig({
entry,