Skip to content

🎥 Make videos programmatically with React

rollup for rive

Jonny Burgerac2297333e17
diff --git a/packages/rive/bundle.ts b/packages/rive/bundle.ts
new file mode 100644
index 0000000000..e11d6328c8
--- /dev/null
+++ b/packages/rive/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',
+ '@rive-app/canvas-advanced',
+ 'react',
+ 'remotion',
+ 'remotion/no-react',
+ ],
+});
+
+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/rive/package.json b/packages/rive/package.json
index 09e35c7e6b..192783f0c7 100644
--- a/packages/rive/package.json
+++ b/packages/rive/package.json
@@ -8,7 +8,7 @@
"scripts": {
"formatting": "prettier src --check",
"lint": "eslint src --ext ts,tsx",
- "build": "rollup --config rollup.config.js && tsc -d",
+ "build": "bun bundle.ts && tsc -d",
"watch": "tsc -w"
},
"repository": {
@@ -30,7 +30,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",
@@ -38,7 +37,6 @@
"prettier": "3.2.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
- "rollup": "^2.70.1",
"prettier-plugin-organize-imports": "3.2.4"
},
"publishConfig": {
diff --git a/packages/rive/rollup.config.js b/packages/rive/rollup.config.js
deleted file mode 100644
index b90cadc052..0000000000
--- a/packages/rive/rollup.config.js
+++ /dev/null
@@ -1,27 +0,0 @@
-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",
- "@rive-app/canvas-advanced",
- ],
- plugins: [
- typescript({
- tsconfig: "tsconfig-esm.json",
- sourceMap: false,
- outputToFilesystem: true,
- }),
- ],
- },
-];
diff --git a/packages/rive/tsconfig-esm.json b/packages/rive/tsconfig-esm.json
deleted file mode 100644
index 06d8292d63..0000000000
--- a/packages/rive/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/pnpm-lock.yaml b/pnpm-lock.yaml
index 00af43cd9d..32b172d242 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1766,9 +1766,6 @@ importers:
'@jonny/eslint-config':
specifier: 3.0.281
- '@rollup/plugin-typescript':
- specifier: ^8.2.0
'@types/node':
specifier: 18.14.6
version: 18.14.6
@@ -1793,9 +1790,6 @@ importers:
react-dom:
specifier: ^18.2.0
version: 18.2.0([email protected])
- rollup:
- specifier: ^2.70.1
- version: 2.76.0
packages/shapes:
dependencies: