Skip to content

🎥 Make videos programmatically with React

Emit shared ESM chunks with mjs extensions

JonnyBurger3ec9bab5a206
diff --git a/packages/.monorepo/builder.ts b/packages/.monorepo/builder.ts
index 32a9b627e0..1a06693d2e 100644
--- a/packages/.monorepo/builder.ts
+++ b/packages/.monorepo/builder.ts
@@ -129,7 +129,13 @@ export const buildPackage = async ({
validateExternal(externalFinal);
const output = await build({
entrypoints: batch.map(({path: entryPath}) => entryPath),
- naming: `[name].${format === 'esm' ? 'mjs' : 'js'}`,
+ naming:
+ action === 'build-shared'
+ ? {
+ entry: `[name].${format === 'esm' ? 'mjs' : 'js'}`,
+ chunk: `[name]-[hash].${format === 'esm' ? 'mjs' : 'js'}`,
+ }
+ : `[name].${format === 'esm' ? 'mjs' : 'js'}`,
external: externalFinal,
target,
format,