[fix] Remove unused dotenv loading from webpack

This commit is contained in:
PauI Ostrovckij
2025-10-20 12:25:59 +03:00
parent 64e9f702dc
commit 924595cbe4

View File

@ -7,13 +7,10 @@ const dotenv = require('dotenv');
module.exports = (env, argv) => {
const mode = argv && argv.mode ? argv.mode : 'development';
// Load environment variables from .env files
// Priority: .env.local > .env.development/.env.production > .env
const envFiles = ['.env.local', mode === 'production' ? '.env.production' : '.env.development', '.env'];
envFiles.forEach(file => {
dotenv.config({path: file});
});
// Load environment variables from .env.development only in development mode
if (mode === 'development') {
dotenv.config({path: '.env.development'});
}
return {
entry: './src/index.js',