python__django_tutorials/ticketing/ticketing-frontend/scripts/show-settings.js

20 lines
673 B
JavaScript

import { loadEnv } from 'vite';
import { resolve } from 'path';
import { fileURLToPath } from 'url';
import { dirname } from 'path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
// Load the environment variables from the project root
const env = loadEnv('development', resolve(__dirname, '../../../'), 'VITE_');
console.log('\n--- Vite Environment Variables ---');
if (Object.keys(env).length === 0) {
console.log('No VITE_ variables found in .env');
} else {
for (const [key, value] of Object.entries(env)) {
console.log(`\x1b[36m${key}\x1b[0m: ${value}`);
}
}
console.log('----------------------------------\n');