Skip to content

The design language that makes your AI harness better at design.

JavaScript

Force [hash] in Bun chunk naming so older Bun versions don't collide

Paul Bakaus8f05b9bfa5bc
diff --git a/scripts/build.js b/scripts/build.js
index bc3505e4d..fd2a00861 100644
--- a/scripts/build.js
+++ b/scripts/build.js
@@ -298,6 +298,16 @@ async function buildStaticSite(extraEntrypoints = []) {
outdir: outdir,
minify: true,
sourcemap: 'linked',
+ // Older Bun versions (e.g. the one Cloudflare Pages ships) emit shared
+ // CSS/JS chunks without a content hash in the filename, which collides
+ // when multiple HTML entries import the same CSS partial. Force the
+ // chunk + asset naming to always include [hash] so the build is
+ // reproducible across Bun versions.
+ naming: {
+ entry: '[dir]/[name].[ext]',
+ chunk: '[name]-[hash].[ext]',
+ asset: '[name]-[hash].[ext]',
+ },
});
if (!result.success) {