Skip to content

🎥 Make videos programmatically with React

lottie

Jonny Burger62637033e3f9
diff --git a/packages/lottie/bundle.ts b/packages/lottie/bundle.ts
new file mode 100644
index 0000000000..1f56e9584a
--- /dev/null
+++ b/packages/lottie/bundle.ts
@@ -0,0 +1,22 @@
+import {build} from 'bun';
+
+const output = await build({
+ entrypoints: ['src/index.ts'],
+ naming: '[name].mjs',
+ external: [
+ 'react/jsx-runtime',
+ 'react',
+ 'remotion',
+ 'remotion/no-react',
+ 'lottie-web',
+ ],
+});
+
+const [file] = output.outputs;
+const text = (await file.text())
+ .replace(/jsxDEV/g, 'jsx')
+ .replace(/react\/jsx-dev-runtime/g, 'react/jsx-runtime');
+
+await Bun.write('dist/esm/index.mjs', text);
+
+export {};
diff --git a/packages/lottie/package.json b/packages/lottie/package.json
index c88ae17a02..7fe29e97ca 100644
--- a/packages/lottie/package.json
+++ b/packages/lottie/package.json
@@ -10,7 +10,7 @@
"formatting": "prettier src --check",
"lint": "eslint src --ext ts,tsx",
"test": "bun test src",
- "build": "rollup --config rollup.config.js && tsc -d",
+ "build": "bun bundle.ts && tsc -d",
"watch": "tsc -w"
},
"repository": {
diff --git a/packages/lottie/rollup.config.js b/packages/lottie/rollup.config.js
deleted file mode 100644
index 60c3873b68..0000000000
--- a/packages/lottie/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', 'lottie-web'],
- plugins: [
- typescript({
- tsconfig: 'tsconfig-esm.json',
- sourceMap: false,
- outputToFilesystem: true,
- }),
- ],
- },
-];
diff --git a/packages/lottie/tsconfig-esm.json b/packages/lottie/tsconfig-esm.json
deleted file mode 100644
index 805e1f04d2..0000000000
--- a/packages/lottie/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"]
-}
diff --git a/packages/noise/.npmignore b/packages/noise/.npmignore
index 8ca8e0f6aa..6f05a1a198 100644
--- a/packages/noise/.npmignore
+++ b/packages/noise/.npmignore
@@ -7,8 +7,5 @@ tsconfig.tsbuildinfo
vitest.config.mts
tsconfig.json
.prettierrc.js
-.rollup
-.rollup.cache
-rollup.config.js
tsconfig-esm.json
dist/tsconfig-esm.tsbuildinfo
diff --git a/packages/rive/.npmignore b/packages/rive/.npmignore
index 314e27a81e..c8672b7d84 100644
--- a/packages/rive/.npmignore
+++ b/packages/rive/.npmignore
@@ -1,6 +1,5 @@
dist/tsconfig-esm.tsbuildinfo
tsconfig-esm.json
src
-rollup.config.js
tsconfig.json
.eslintrc