From e08035ded9a729ab18f4ae33df5be5f0fd9ed206 Mon Sep 17 00:00:00 2001 From: lazarv Date: Thu, 5 Dec 2024 08:56:50 +0100 Subject: [PATCH] fix: build with custom public dir --- packages/react-server/lib/build/server.mjs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/react-server/lib/build/server.mjs b/packages/react-server/lib/build/server.mjs index 0e9bc88..2856a95 100644 --- a/packages/react-server/lib/build/server.mjs +++ b/packages/react-server/lib/build/server.mjs @@ -99,6 +99,8 @@ export default async function serverBuild(root, options) { return false; }; + const publicDir = + typeof config.public === "string" ? config.public : "public"; const buildConfig = { root: cwd, configFile: false, @@ -232,6 +234,7 @@ export default async function serverBuild(root, options) { externalConditions: ["react-server"], }, }, + publicDir: join(cwd, publicDir), }; let viteConfig = buildConfig;