Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(config): use static preset if static flag is set #2860

Merged
merged 1 commit into from
Nov 8, 2024
Merged
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
12 changes: 7 additions & 5 deletions src/core/config/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,13 @@ async function _loadUserConfig(
preset: presetOverride,
},
async defaultConfig({ configs }) {
const getConf = <K extends keyof NitroConfig>(key: K) =>
(configs.main?.[key] ??
configs.rc?.[key] ??
configs.packageJson?.[key]) as NitroConfig[K];

if (!compatibilityDate) {
compatibilityDate =
configs.main?.compatibilityDate ||
configs.rc?.compatibilityDate ||
configs.packageJson?.compatibilityDate;
compatibilityDate = getConf("compatibilityDate");
}
const framework = configs.overrides?.framework || configs.main?.framework;
return {
Expand All @@ -116,7 +118,7 @@ async function _loadUserConfig(
presetOverride ||
(
await resolvePreset("" /* auto detect */, {
static: configOverrides.static,
static: getConf("static"),
compatibilityDate: compatibilityDate || fallbackCompatibilityDate,
})
)?._meta?.name,
Expand Down