diff --git a/packages/cli/src/lib/bundler/bundle.ts b/packages/cli/src/lib/bundler/bundle.ts index b99891d70d..e9b20aea3c 100644 --- a/packages/cli/src/lib/bundler/bundle.ts +++ b/packages/cli/src/lib/bundler/bundle.ts @@ -82,10 +82,15 @@ export async function buildBundle(options: BuildOptions) { await fs.emptyDir(paths.targetDist); if (paths.targetPublic) { - await fs.copy(paths.targetPublic, paths.targetDist, { - dereference: true, - filter: file => file !== paths.targetHtml, - }); + await fs.copy( + paths.targetPublic, + // If we've got a separate public index entry point, copy public content there instead + publicPaths?.targetDist ?? paths.targetDist, + { + dereference: true, + filter: file => file !== paths.targetHtml, + }, + ); } if (configSchema) {