From 1949f6144083c9c3ec6b5934015a0ede782464a9 Mon Sep 17 00:00:00 2001 From: Andres Morey Date: Wed, 22 May 2024 07:54:56 +0300 Subject: [PATCH] Improvements (#94) * Removes unnecessary logging statement in main.tsx * Adds sourcemaps to frontend build * Upgrades node in docker build -> 20.13.1 * Upgrades pnpm in docker build -> 9.1.2 --- Dockerfile | 4 ++-- frontend/src/main.tsx | 7 ------- frontend/vite.config.ts | 1 + 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index eb0f6e3d..46431323 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,13 +32,13 @@ CMD [] # ----------------------------------------------------------- -FROM node:20.12.2-alpine3.19 AS frontend-builder +FROM node:20.13.1-alpine3.19 AS frontend-builder WORKDIR /frontend # enable pnpm RUN corepack enable -RUN corepack prepare pnpm@9.0.6 --activate +RUN corepack prepare pnpm@9.1.2 --activate # set up git+ssh for private package download from github RUN apk add git openssh-client diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 16e5900a..ae1db89a 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -25,13 +25,6 @@ import { ThemeProvider } from '@/lib/theme'; import './index.css'; -// handle runtimeConfig (inserted by server in production) -if ('runtimeConfig' in window) { - // @ts-expect-error 'window.runtimeConfig' is of type 'unknown' - import.meta.env.VITE_HELLO = window.runtimeConfig.basePath; - console.log(import.meta.env.VITE_HELLO); -} - const router = createBrowserRouter(createRoutesFromElements(routes), { basename: getBasename() }); ReactDOM.createRoot(document.getElementById('root')!).render( diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 1aa77d53..b40a9488 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -35,6 +35,7 @@ export default defineConfig({ }, build: { manifest: true, + sourcemap: true, }, test: { environment: 'jsdom',