diff --git a/Dockerfile b/Dockerfile index 849d93f..7862ca0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -60,7 +60,6 @@ CMD ["bun", "run", "dev"] FROM oven/bun:${BUN_VERSION} AS builder ARG APP_VERSION=dev -ENV VITE_APP_VERSION=${APP_VERSION} WORKDIR /app @@ -69,6 +68,9 @@ RUN bun install --frozen-lockfile COPY . . +RUN touch .env +RUN echo "VITE_APP_VERSION=${APP_VERSION}" >> .env + RUN bun run build FROM base AS production diff --git a/vite.config.ts b/vite.config.ts index f456fcc..e55ab31 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -4,15 +4,8 @@ import { defineConfig } from "vite"; import tsconfigPaths from "vite-tsconfig-paths"; import { reactRouterHonoServer } from "react-router-hono-server/dev"; -const getVersion = () => { - return process.env.VITE_APP_VERSION || "dev"; -}; - export default defineConfig({ plugins: [reactRouterHonoServer({ runtime: "bun" }), reactRouter(), tailwindcss(), tsconfigPaths()], - define: { - "import.meta.env.VITE_APP_VERSION": JSON.stringify(getVersion()), - }, build: { outDir: "dist", sourcemap: true,