From cbf85313af09d186f1459bd297dc8efbfa04e6f8 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 2 Oct 2025 17:30:12 -0500 Subject: [PATCH] Enable sourcemap, fix output filenames --- src/lib/build/index.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib/build/index.ts b/src/lib/build/index.ts index 8dd0bb96..a424c05b 100644 --- a/src/lib/build/index.ts +++ b/src/lib/build/index.ts @@ -73,6 +73,10 @@ async function bundle( outdir: "/", jsx: "automatic", metafile: true, + sourcemap: true, + entryNames: "[name]-[hash]", + chunkNames: "[name]-[hash]", + assetNames: "[name]-[hash]", plugins: [ shakespearePlugin(), fsPlugin(fs, `${projectPath}/src`), @@ -87,8 +91,8 @@ async function bundle( for (const file of results.outputFiles) { const ext = file.path.split('.').pop(); - const filename = `${file.path.split('/').pop()?.split('.')?.[0] || "chunk"}-${file.hash}.${ext}`; - const entryPoint = results.metafile.outputs[file.path.slice(1)]?.entryPoint?.replace(/^fs:/, ''); + const filename = `${file.path.slice(1)}`; + const entryPoint = results.metafile.outputs[filename]?.entryPoint?.replace(/^fs:/, ''); const script = entryPoint ? entryScripts[entryPoint] : null; if (script) { @@ -106,6 +110,8 @@ async function bundle( style.setAttribute("type", "text/tailwindcss"); style.textContent = file.text; doc.head.appendChild(style); + } else { + dist[filename] = file.contents; } }