Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/config/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const resolveConfig = async function (opts) {
mode,
debug,
logs,
featureFlags,
featureFlags: passedFeatureFlags,
} = await normalizeOpts(optsA)

const { siteInfo, accounts, addons, integrations } = await getSiteInfo({
Expand All @@ -72,10 +72,15 @@ export const resolveConfig = async function (opts) {
mode,
offline,
siteFeatureFlagPrefix,
featureFlags,
featureFlags: passedFeatureFlags,
testOpts,
})

// Feature flags can also be loaded from the call to `getSiteInfo()`, in the CLI
// these won't be accessible within the calls to `netlify-config` as they're fetched
// too late. We merge them here to ensure they're available to this package.
const featureFlags = { ...passedFeatureFlags, ...(siteInfo.feature_flags ?? {}) }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need this fallback?

Suggested change
const featureFlags = { ...passedFeatureFlags, ...(siteInfo.feature_flags ?? {}) }
const featureFlags = { ...passedFeatureFlags, ...siteInfo.feature_flags }


const { defaultConfig: defaultConfigA, baseRelDir: baseRelDirA } = parseDefaultConfig({
defaultConfig,
base,
Expand Down