|
|
@@ -65,24 +65,23 @@ const baselineFlag = process.argv.includes("--baseline")
|
|
|
const skipInstall = process.argv.includes("--skip-install")
|
|
|
const skipEmbedWebUi = process.argv.includes("--skip-embed-web-ui")
|
|
|
|
|
|
-
|
|
|
-const createEmbeddedWebUIBundle = async()=>{
|
|
|
- console.log(`Building Web UI to embed in the binary`);
|
|
|
- const appDir = path.join(import.meta.dirname, "../../app")
|
|
|
- await $`bun run --cwd ${appDir} build`;
|
|
|
- const allFiles = await Array.fromAsync(new Bun.Glob("**/*").scan({ cwd: path.join(appDir, "dist")}));
|
|
|
- const fileMap = `
|
|
|
+const createEmbeddedWebUIBundle = async () => {
|
|
|
+ console.log(`Building Web UI to embed in the binary`)
|
|
|
+ const appDir = path.join(import.meta.dirname, "../../app")
|
|
|
+ await $`bun run --cwd ${appDir} build`
|
|
|
+ const allFiles = await Array.fromAsync(new Bun.Glob("**/*").scan({ cwd: path.join(appDir, "dist") }))
|
|
|
+ const fileMap = `
|
|
|
// Import all files as file_$i with type: "file"
|
|
|
${allFiles.map((filePath, i) => `import file_${i} from "${path.join(appDir, "dist", filePath)}" with { type: "file" };`).join("\n")}
|
|
|
// Export with original mappings
|
|
|
export default {
|
|
|
- ${allFiles.map((filePath, i)=>`"${filePath}": file_${i},`).join("\n")}
|
|
|
+ ${allFiles.map((filePath, i) => `"${filePath}": file_${i},`).join("\n")}
|
|
|
}
|
|
|
`.trim()
|
|
|
- return fileMap;
|
|
|
+ return fileMap
|
|
|
}
|
|
|
|
|
|
-const embeddedFileMap = skipEmbedWebUi ? null : await createEmbeddedWebUIBundle();
|
|
|
+const embeddedFileMap = skipEmbedWebUi ? null : await createEmbeddedWebUIBundle()
|
|
|
|
|
|
const allTargets: {
|
|
|
os: string
|