Skip to content

🎥 Make videos programmatically with React

bun noise

Jonny Burgerf733be2cba8d
diff --git a/packages/noise/bundle.ts b/packages/noise/bundle.ts
new file mode 100644
index 0000000000..dc587bea1d
--- /dev/null
+++ b/packages/noise/bundle.ts
@@ -0,0 +1,16 @@
+import {build} from 'bun';
+
+const output = await build({
+ entrypoints: ['src/index.ts'],
+ naming: '[name].mjs',
+ external: ['remotion', 'remotion/no-react', 'simplex-noise'],
+});
+
+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/noise/package.json b/packages/noise/package.json
index 3c7f2a35cc..3e5dc2f1ec 100644
--- a/packages/noise/package.json
+++ b/packages/noise/package.json
@@ -10,7 +10,7 @@
"formatting": "prettier src --check",
"lint": "eslint src --ext ts,tsx",
"watch": "tsc -w",
- "build": "rollup --config rollup.config.js && tsc -d",
+ "build": "bun bundle.ts && tsc -d",
"test": "vitest --run"
},
"exports": {
@@ -41,12 +41,10 @@
},
"devDependencies": {
"@jonny/eslint-config": "3.0.281",
- "@rollup/plugin-typescript": "^8.2.0",
"@types/node": "18.14.6",
"eslint": "8.56.0",
"prettier": "3.2.5",
"prettier-plugin-organize-imports": "3.2.4",
- "rollup": "^2.70.1",
"vitest": "0.31.1"
},
"keywords": [
diff --git a/packages/noise/rollup.config.js b/packages/noise/rollup.config.js
deleted file mode 100644
index 29e9e02725..0000000000
--- a/packages/noise/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', 'simplex-noise'],
- plugins: [
- typescript({
- tsconfig: 'tsconfig-esm.json',
- sourceMap: false,
- outputToFilesystem: true,
- }),
- ],
- },
-];
diff --git a/packages/noise/tsconfig-esm.json b/packages/noise/tsconfig-esm.json
deleted file mode 100644
index 38c57cd749..0000000000
--- a/packages/noise/tsconfig-esm.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "extends": "../tsconfig-esm.settings.json",
- "compilerOptions": {
- "rootDir": "./src",
- "outDir": "./dist/esm",
- "skipLibCheck": true,
- "jsx": "react-jsx",
- "moduleResolution": "node"
- },
- "include": ["./src"]
-}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 7844d68289..00af43cd9d 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1469,9 +1469,6 @@ importers:
'@jonny/eslint-config':
specifier: 3.0.281
- '@rollup/plugin-typescript':
- specifier: ^8.2.0
'@types/react':
specifier: 18.2.48
version: 18.2.48
@@ -1490,9 +1487,6 @@ importers:
react-dom:
specifier: 18.2.0
version: 18.2.0([email protected])
- rollup:
- specifier: ^2.70.1
- version: 2.76.0
packages/noise:
dependencies:
@@ -1506,9 +1500,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
@@ -1521,9 +1512,6 @@ importers:
prettier-plugin-organize-imports:
specifier: 3.2.4
- rollup:
- specifier: ^2.70.1
- version: 2.76.0
vitest:
specifier: 0.31.1
@@ -2154,9 +2142,6 @@ importers:
'@react-three/fiber':
specifier: 8.13.5
- '@rollup/plugin-typescript':
- specifier: ^8.2.0
'@types/node':
specifier: 18.14.6
version: 18.14.6
@@ -2187,9 +2172,6 @@ importers:
react-dom:
specifier: 18.2.0
version: 18.2.0([email protected])
- rollup:
- specifier: ^2.70.1
- version: 2.76.0
three:
specifier: 0.158.0
version: 0.158.0