Skip to content

🎥 Make videos programmatically with React

Update bundle.ts

Jonny Burger8d76e93366b9
diff --git a/packages/google-fonts/bundle.ts b/packages/google-fonts/bundle.ts
index 77cbd73246..1f03876bd5 100644
--- a/packages/google-fonts/bundle.ts
+++ b/packages/google-fonts/bundle.ts
@@ -27,7 +27,12 @@ for (const file of output.outputs) {
const str = await file.text();
const newStr = str
.replace(/jsxDEV/g, "jsx")
- .replace(/react\/jsx-dev-runtime/g, "react/jsx-runtime");
+ .replace(/react\/jsx-dev-runtime/g, "react/jsx-runtime")
+ .replace(/import\(\"(.*)\"\)/g, 'import("$1.mjs")');
+
+ if (newStr.includes(`import("./ABeeZee")`)) {
+ throw new Error("not compiled correctly");
+ }
Bun.write(path.join("dist", "esm", file.path), newStr);
}