mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Enable sourcemap, fix output filenames
This commit is contained in:
1 file changed
+8
-2
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user