🔧(frontend) add conditional sourcemap generation for error tracking

Enable sourcemaps via env variable to link Sentry/PostHog exceptions to
source code. Enable by default for DINUM frontend image to improve
debugging capabilities.
This commit is contained in:
lebaudantoine
2025-07-08 14:37:23 +02:00
committed by aleb_the_flash
parent 9e57c25a25
commit 053e4bc7b9
2 changed files with 4 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ FROM frontend-deps AS meet-builder
WORKDIR /home/frontend WORKDIR /home/frontend
ENV VITE_APP_TITLE="Visio" ENV VITE_APP_TITLE="Visio"
ENV VITE_BUILD_SOURCEMAP="true"
RUN npm run build RUN npm run build

View File

@@ -7,6 +7,9 @@ export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd()) const env = loadEnv(mode, process.cwd())
return { return {
plugins: [react(), tsconfigPaths()], plugins: [react(), tsconfigPaths()],
build: {
sourcemap: env.VITE_BUILD_SOURCEMAP === 'true',
},
server: { server: {
port: parseInt(env.VITE_PORT) || 3000, port: parseInt(env.VITE_PORT) || 3000,
host: env.VITE_HOST ?? 'localhost', host: env.VITE_HOST ?? 'localhost',