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:
1 parent
250b6fdf22
commit
8890f28470
6 files changed
+83
-17
No files matched your search
@@ -12,6 +12,7 @@ export default async function build({
|
||||
}) {
|
||||
const container = await initializeContainer(directory, {
|
||||
skipDbConnection: true,
|
||||
throwOnError: false,
|
||||
})
|
||||
const logger = container.resolve(ContainerRegistrationKeys.LOGGER)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user