@platformatic/foundation 3.32.0 → 3.33.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/configuration.js +8 -3
- package/lib/module.js +1 -1
- package/package.json +1 -1
package/lib/configuration.js
CHANGED
|
@@ -532,9 +532,14 @@ export async function loadConfiguration (source, schema, options = {}) {
|
|
|
532
532
|
return config
|
|
533
533
|
}
|
|
534
534
|
|
|
535
|
-
export function loadConfigurationModule (root, config, pkg) {
|
|
535
|
+
export async function loadConfigurationModule (root, config, pkg) {
|
|
536
536
|
pkg ??= extractModuleFromSchemaUrl(config, true).module
|
|
537
537
|
|
|
538
|
-
|
|
539
|
-
|
|
538
|
+
try {
|
|
539
|
+
const require = createRequire(resolve(root, 'noop.js'))
|
|
540
|
+
return await loadModule(require, pkg)
|
|
541
|
+
} catch (error) { // Fallback to the one bundled with Platformatic runtime
|
|
542
|
+
const require = createRequire(import.meta.filename)
|
|
543
|
+
return loadModule(require, pkg)
|
|
544
|
+
}
|
|
540
545
|
}
|
package/lib/module.js
CHANGED