cli: copy public files to public dist dir when used

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2024-04-06 11:53:21 +02:00
parent 721359b950
commit 837071a57b
+9 -4
View File
@@ -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) {