From e8ec5124f61d636e1487d9b544d55b0806822e68 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 10 Feb 2026 15:19:09 -0800 Subject: fix build mode --- Dockerfile | 11 ++--- src/app.css | 62 ------------------------- src/routes/(app)/send/invoice/[id]/+page.svelte | 4 +- vite.config.js | 2 +- 4 files changed, 8 insertions(+), 71 deletions(-) diff --git a/Dockerfile b/Dockerfile index 70b86c82..2d3fbf43 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,5 @@ FROM oven/bun -ARG NODE_ENV=production -ENV NODE_ENV=$NODE_ENV - WORKDIR /app ADD package.json . @@ -10,8 +7,10 @@ RUN NODE_ENV=development bun i COPY . . -ARG BUILD_MODE=build -RUN bun run $BUILD_MODE +ARG VITE_MODE=production +RUN rm -f .env .env.local .env.production .env.production.local && \ + NODE_ENV=production bunx vite build --mode $VITE_MODE + +ENV NODE_ENV=production -# CMD ["node", "build"] CMD ["bun", "run", "preview", "--host", "--port", "3000"] diff --git a/src/app.css b/src/app.css index 0f713d72..f310b65c 100644 --- a/src/app.css +++ b/src/app.css @@ -47,68 +47,6 @@ --toastBackground: #292929; } -/* svelte-toast styles - component scoped CSS doesn't survive Svelte 5 compilation */ -._toastContainer { - top: var(--toastContainerTop, 1.5rem); - right: var(--toastContainerRight, 2rem); - bottom: var(--toastContainerBottom, auto); - left: var(--toastContainerLeft, auto); - position: fixed; - margin: 0; - padding: 0; - list-style-type: none; - pointer-events: none; - z-index: var(--toastContainerZIndex, 9999); -} -._toastItem { - width: var(--toastWidth, 16rem); - height: var(--toastHeight, auto); - min-height: var(--toastMinHeight, 3.5rem); - margin: var(--toastMargin, 0 0 0.5rem 0); - padding: var(--toastPadding, 0); - background: var(--toastBackground, rgba(66, 66, 66, 0.9)); - color: var(--toastColor, #fff); - box-shadow: var(--toastBoxShadow, 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)); - border: var(--toastBorder, none); - border-radius: var(--toastBorderRadius, 0.125rem); - position: relative; - display: flex; - flex-direction: row; - align-items: center; - overflow: hidden; - will-change: transform, opacity; - -webkit-tap-highlight-color: transparent; -} -._toastMsg { - padding: var(--toastMsgPadding, 0.75rem 0.5rem); - flex: 1 1 0%; -} -._toastBar { - top: var(--toastBarTop, auto); - right: var(--toastBarRight, auto); - bottom: var(--toastBarBottom, 0); - left: var(--toastBarLeft, 0); - height: var(--toastBarHeight, 6px); - width: var(--toastBarWidth, 100%); - position: absolute; - display: block; - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - border: none; - background: transparent; - pointer-events: none; -} -._toastBar::-webkit-progress-bar { - background: transparent; -} -._toastBar::-webkit-progress-value { - background: var(--toastProgressBackground, var(--toastBarBackground, rgba(33, 150, 243, 0.75))); -} -._toastBar::-moz-progress-bar { - background: var(--toastProgressBackground, var(--toastBarBackground, rgba(33, 150, 243, 0.75))); -} - html { font-family: PublicSans, sans-serif; } ::selection { color: black; background: #eaf2ff; } diff --git a/src/routes/(app)/send/invoice/[id]/+page.svelte b/src/routes/(app)/send/invoice/[id]/+page.svelte index 9cc2f0a6..0c67caa1 100644 --- a/src/routes/(app)/send/invoice/[id]/+page.svelte +++ b/src/routes/(app)/send/invoice/[id]/+page.svelte @@ -27,10 +27,10 @@ let { data, form } = $props(); let { trusted, balance, invoice, user } = $state(data); - let { address, hash, payreq, user: recipient, tip } = $state(invoice); + let { address, hash, payreq, user: recipient, tip } = $state(data.invoice); let { currency } = $derived(user); let locale = $derived(loc(user)); - let { amount } = $state(form || invoice); + let amount = $state(form?.amount ?? data.invoice.amount); let rate = $derived(invoice.rate * (data.rate / data.invoiceRate)); diff --git a/vite.config.js b/vite.config.js index e5cb9a03..1d4fe742 100644 --- a/vite.config.js +++ b/vite.config.js @@ -48,7 +48,7 @@ export default defineConfig(({ mode }) => { if (id.includes("node_modules")) { const parts = id.split("node_modules/")[1].split("/"); const pkg = parts[0].startsWith("@") - ? `${parts[0]}/${parts[1]}` + ? `${parts[0].slice(1)}-${parts[1]}` : parts[0]; return `vendor-${pkg}`; } -- cgit v1.2.3