Skip to content

🎥 Make videos programmatically with React

also GIF

Jonny Burgerf960271fa366
diff --git a/packages/gif/build.ts b/packages/gif/build.ts
new file mode 100644
index 0000000000..cfe7f87f91
--- /dev/null
+++ b/packages/gif/build.ts
@@ -0,0 +1,15 @@
+import {build} from 'bun';
+
+const output = await build({
+ entrypoints: ['src/index.ts'],
+ naming: '[name].mjs',
+ target: 'node',
+ external: ['remotion', 'remotion/no-react', 'react'],
+});
+
+const [file] = output.outputs;
+const text = await file.text();
+
+await Bun.write('dist/esm/index.mjs', text);
+
+export {};
diff --git a/packages/gif/package.json b/packages/gif/package.json
index c5bd28f08f..6feae10dd7 100644
--- a/packages/gif/package.json
+++ b/packages/gif/package.json
@@ -17,7 +17,7 @@
"scripts": {
"formatting": "prettier src --check",
"lint": "eslint src --ext ts,tsx",
- "build": "node build.mjs && rollup --failAfterWarnings --config rollup.config.js && tsc -d",
+ "build": "node build.mjs && bun build.ts && tsc -d",
"watch": "tsc -w"
},
"exports": {
@@ -34,7 +34,6 @@
},
"devDependencies": {
"@jonny/eslint-config": "3.0.281",
- "@rollup/plugin-typescript": "^8.2.0",
"@types/node": "18.14.6",
"@types/react": "18.2.48",
"@types/react-dom": "18.2.18",
@@ -44,7 +43,6 @@
"prettier-plugin-organize-imports": "3.2.4",
"react": "18.2.0",
"react-dom": "18.2.0",
- "rollup": "^2.70.1",
"webpack": "5.83.1"
},
"peerDependencies": {
diff --git a/packages/gif/rollup.config.js b/packages/gif/rollup.config.js
deleted file mode 100644
index 145571d05a..0000000000
--- a/packages/gif/rollup.config.js
+++ /dev/null
@@ -1,23 +0,0 @@
-// rollup.config.js
-import typescript from '@rollup/plugin-typescript';
-
-export default [
- {
- input: 'src/index.ts',
- output: [
- {
- file: 'dist/esm/index.mjs',
- format: 'es',
- sourcemap: false,
- },
- ],
- external: ['react', 'remotion', 'react/jsx-runtime'],
- plugins: [
- typescript({
- tsconfig: 'tsconfig-esm.json',
- sourceMap: false,
- outputToFilesystem: true,
- }),
- ],
- },
-];
diff --git a/packages/gif/tsconfig-esm.json b/packages/gif/tsconfig-esm.json
deleted file mode 100644
index 805e1f04d2..0000000000
--- a/packages/gif/tsconfig-esm.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "extends": "../tsconfig-esm.settings.json",
- "compilerOptions": {
- "rootDir": "./src",
- "outDir": "./dist/esm",
- "skipLibCheck": true,
- "jsx": "react-jsx",
- "moduleResolution": "node"
- },
- "references": [{"path": "../core"}],
- "include": ["./src"]
-}