feat(medusa): Prevent build command from throwing on missing config (#14540)

**What**
Prevent the build command from failing on mising config
This commit is contained in:
Adrien de Peretti authored and GitHub committed 2026-01-15 09:00:15 +00:00
1 parent 250b6fdf22
commit 8890f28470
6 files changed
+83 -17

No files matched your search

+1
View File
@@ -12,6 +12,7 @@ export default async function build({
}) {
const container = await initializeContainer(directory, {
skipDbConnection: true,
throwOnError: false,
})
const logger = container.resolve(ContainerRegistrationKeys.LOGGER)
+4 -1
View File
@@ -134,10 +134,13 @@ export async function initializeContainer(
rootDirectory: string,
options?: {
skipDbConnection?: boolean
throwOnError?: boolean
}
): Promise<MedusaContainer> {
await featureFlagsLoader(rootDirectory)
const configDir = await configLoader(rootDirectory, "medusa-config")
const configDir = await configLoader(rootDirectory, "medusa-config", {
throwOnError: options?.throwOnError,
})
await featureFlagsLoader(join(__dirname, ".."))
const customLogger = configDir.logger ?? defaultLogger