change(ui): webpack config to use env vars

This commit is contained in:
Shekar Siri 2025-03-07 17:50:32 +01:00
parent 90bc6bc83e
commit 41178ba841

View file

@ -8,8 +8,8 @@ import MiniCssExtractPlugin from 'mini-css-extract-plugin';
import CompressionPlugin from "compression-webpack-plugin";
import { EsbuildPlugin } from 'esbuild-loader';
const dotenv = require('dotenv').config({ path: __dirname + '/.env' })
const isDevelopment = process.env.NODE_ENV !== 'production'
const dotenv = require('dotenv').config({ path: __dirname + (isDevelopment ? '/.env' : '/.env.production') });
const stylesHandler = MiniCssExtractPlugin.loader;
const ENV_VARIABLES = JSON.stringify(dotenv.parsed);
import pathAlias from './path-alias';