Skip to content

Commit

Permalink
fix(build): do not remove index.html when buildConfig is empty (#851)
Browse files Browse the repository at this point in the history
just to cover an edge case.
  • Loading branch information
dai-shi committed Aug 27, 2024
1 parent 06615f6 commit bfc2629
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/waku/src/lib/builder/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,10 @@ const emitHtmlFiles = async (
const publicIndexHtml = await readFile(publicIndexHtmlFile, {
encoding: 'utf8',
});
await unlink(publicIndexHtmlFile);
if (buildConfig.length) {
// Delete the default index.html file unless buildConfig is empty.
await unlink(publicIndexHtmlFile);
}
const publicIndexHtmlHead = publicIndexHtml.replace(
/.*?<head>(.*?)<\/head>.*/s,
'$1',
Expand Down

0 comments on commit bfc2629

Please sign in to comment.