Skip to content

🎥 Make videos programmatically with React

Fix bundling of streaming package

Jonny Burger47b652a4e138
diff --git a/packages/streaming/bundle.ts b/packages/streaming/bundle.ts
new file mode 100644
index 0000000000..06dca1b15e
--- /dev/null
+++ b/packages/streaming/bundle.ts
@@ -0,0 +1,15 @@
+import {buildPackage} from '../.monorepo/builder';
+
+await buildPackage({
+ formats: {
+ cjs: 'use-tsc',
+ esm: 'build',
+ },
+ external: 'dependencies',
+ entrypoints: [
+ {
+ path: 'src/index.ts',
+ target: 'node',
+ },
+ ],
+});
diff --git a/packages/streaming/package.json b/packages/streaming/package.json
index 90fdc27105..2e15dde3d1 100644
--- a/packages/streaming/package.json
+++ b/packages/streaming/package.json
@@ -10,7 +10,7 @@
"scripts": {
"lint": "eslint src",
"formatting": "prettier src --check",
- "make": "tsc -d"
+ "make": "tsc -d && bun --env-file=../.env.bundle bundle.ts"
},
"author": "Jonny Burger <[email protected]>",
"contributors": [],
@@ -26,7 +26,12 @@
"eslint": "9.19.0"
},
"exports": {
- ".": "./dist/index.js",
- "./package.json": "./package.json"
+ "./package.json": "./package.json",
+ ".": {
+ "types": "./dist/index.d.ts",
+ "require": "./dist/index.js",
+ "module": "./dist/esm/index.mjs",
+ "import": "./dist/esm/index.mjs"
+ }
}
}