From 5488df4318e02adc09618b1f25fbb007681b2fa5 Mon Sep 17 00:00:00 2001 From: GotthardG <51994228+GotthardG@users.noreply.github.com> Date: Tue, 10 Dec 2024 22:13:28 +0100 Subject: [PATCH] fixed bug with spreadsheet import --- frontend/package.json | 4 ++-- frontend/vite.config.ts | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 94e6b40..96c17e9 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -8,8 +8,8 @@ "build": "tsc -b && vite build", "lint": "eslint .", "preview": "vite preview", - "start-dev": "cross-env NODE_ENV=dev vite", - "start-test": "cross-env NODE_ENV=test vite", + "start-dev": "vite --mode dev", + "start-test": "vite --mode test", "watch:openapi": "node fetch-openapi.js" }, "dependencies": { diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 4f406f7..c45b54f 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -1,20 +1,22 @@ -import { defineConfig, loadEnv } from 'vite'; +import { defineConfig, loadEnv } from 'vite'; import react from '@vitejs/plugin-react'; -import path from 'path'; export default defineConfig(({ mode }) => { + // Charge les variables du .env correspondant au mode const env = loadEnv(mode, process.cwd(), ''); + console.log(`Active mode: ${mode}`); + console.log('Environment variable loaded:', env); + return { - plugins: [ - react(), - ], + plugins: [react()], server: { https: { key: env.VITE_SSL_KEY_PATH, cert: env.VITE_SSL_CERT_PATH, }, - host: true, // This allows hosting on network interfaces - port: 5173 // Optional: Specify a custom port (default is 5173) - }} + host: true, + port: 5173, + }, + }; }); \ No newline at end of file