Correct Docker build CI/CD
This commit is contained in:
@@ -1,16 +1,13 @@
|
||||
// Define your config interface
|
||||
export interface AppConfig {
|
||||
API_BASE_URL: string;
|
||||
OTHER_VAR: string;
|
||||
}
|
||||
|
||||
// Global variable that will be set at runtime
|
||||
let runtimeConfig: AppConfig = {
|
||||
API_BASE_URL: import.meta.env.VITE_API_BASE_URL || '',
|
||||
OTHER_VAR: import.meta.env.VITE_OTHER_VAR || ''
|
||||
};
|
||||
|
||||
// Function to initialize config at runtime
|
||||
export function initConfig(config: Partial<AppConfig>) {
|
||||
runtimeConfig = {
|
||||
...runtimeConfig,
|
||||
@@ -18,7 +15,6 @@ export function initConfig(config: Partial<AppConfig>) {
|
||||
};
|
||||
}
|
||||
|
||||
// Accessor function
|
||||
export function getConfig(): AppConfig {
|
||||
return runtimeConfig;
|
||||
}
|
||||
Reference in New Issue
Block a user