From 800d3f87c4b7d95964728e404ccdec77cfc07bbc Mon Sep 17 00:00:00 2001 From: Nick Kruczek Date: Thu, 26 Dec 2024 18:13:48 -0500 Subject: [PATCH 1/2] Added support for using 'loadConfig' when bundled with esbuild. --- app-config-utils/src/index.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/app-config-utils/src/index.ts b/app-config-utils/src/index.ts index 2b9ce8b6..f4c8bb12 100644 --- a/app-config-utils/src/index.ts +++ b/app-config-utils/src/index.ts @@ -58,7 +58,11 @@ export function generateModuleText( throw new Error('Config is not loaded in ${privateName}'); } - export { config }; + function loadConfig() { + return new Promise(resolve => {resolve(config)}) + } + + export { config, loadConfig }; export default config; `; } else if (useGlobalNamespace) { @@ -80,7 +84,11 @@ export function generateModuleText( globalNamespace.${privateName} = config; } - export { config }; + function loadConfig() { + return new Promise(resolve => {resolve(config)}) + } + + export { config, loadConfig }; export default config; `; } else { @@ -89,7 +97,11 @@ export function generateModuleText( generatedText += ` const config = ${config}; - export { config }; + function loadConfig() { + return new Promise(resolve => {resolve(config)}) + } + + export { config, loadConfig }; export default config; `; } From 90db09270e2d530d1e355e45be49c8dc9a465a72 Mon Sep 17 00:00:00 2001 From: Nick Kruczek Date: Thu, 26 Dec 2024 18:18:10 -0500 Subject: [PATCH 2/2] Bumped version for utils package.json. --- app-config-utils/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app-config-utils/package.json b/app-config-utils/package.json index 11a817d0..215d2ca4 100644 --- a/app-config-utils/package.json +++ b/app-config-utils/package.json @@ -1,7 +1,7 @@ { "name": "@app-config/utils", "description": "Common utilities used in @app-config", - "version": "2.8.7", + "version": "2.9.0", "license": "MPL-2.0", "author": { "name": "Launchcode",