mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
commit
00c0abdf73
4 changed files with 2154 additions and 3102 deletions
5222
client/package-lock.json
generated
5222
client/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -1,7 +1,9 @@
|
|||
// constants.tsx
|
||||
const ENV_VARIABLES = {
|
||||
MODE: 'production',
|
||||
VITE_BACKEND_URL: process.env.VITE_BACKEND_URL || ""
|
||||
VITE_BACKEND_URL: import.meta.env.VITE_BACKEND_URL || ""
|
||||
};
|
||||
|
||||
console.log(`ENV_VARIABLES.VITE_BACKEND_URL=${ENV_VARIABLES.VITE_BACKEND_URL}`);
|
||||
|
||||
export { ENV_VARIABLES };
|
||||
|
|
|
|||
|
|
@ -3,13 +3,22 @@ import react from '@vitejs/plugin-react-swc';
|
|||
import pluginChecker from 'vite-plugin-checker';
|
||||
import EnvironmentPlugin from 'vite-plugin-environment';
|
||||
|
||||
// Filter out environment variables with invalid identifiers
|
||||
const filteredEnv = Object.keys(process.env).reduce((acc, key) => {
|
||||
// Only include environment variables with valid JavaScript identifiers
|
||||
if (/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(key)) {
|
||||
acc[key] = process.env[key];
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
base: "/",
|
||||
plugins: [
|
||||
react(),
|
||||
pluginChecker({ typescript: true }),
|
||||
EnvironmentPlugin('all'),
|
||||
EnvironmentPlugin(filteredEnv),
|
||||
],
|
||||
preview: {
|
||||
port: 5173,
|
||||
|
|
@ -23,5 +32,10 @@ export default defineConfig({
|
|||
},
|
||||
build: {
|
||||
sourcemap: true, // Enable source maps
|
||||
rollupOptions: {
|
||||
output: {
|
||||
sourcemapExcludeSources: true, // Exclude sources from source maps
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
version: '3'
|
||||
|
||||
services:
|
||||
|
||||
frontend:
|
||||
|
|
|
|||
Loading…
Reference in a new issue