fix(build): extract STORED_LOGO_SENTINEL to non-server module

Vite/React Router refused to bundle the client because
app/routes/app.settings.tsx imported the constant from a .server file
and used it inside the route component (not just loader/action), so it
could not be tree-shaken out.

Move the sentinel to logoCache.constants.ts, re-export from
logoCache.server.ts for backwards compatibility, and import the constant
from constants in the route while keeping the server-only functions
(deleteStoredLogo, storeUploadedLogo) imported from .server (they are
only referenced inside the action and get tree-shaken correctly).
This commit is contained in:
Gerhard Scheikl
2026-05-08 14:41:48 +02:00
parent 23246fe31f
commit 58cfc30cd7
3 changed files with 12 additions and 2 deletions
+1 -1
View File
@@ -8,8 +8,8 @@ import {
isValidIban,
normaliseIban,
} from "../services/invoice/validation";
import { STORED_LOGO_SENTINEL } from "../services/invoice/logoCache.constants";
import {
STORED_LOGO_SENTINEL,
deleteStoredLogo,
storeUploadedLogo,
} from "../services/invoice/logoCache.server";