Skip to content

Commit

Permalink
fix(config): use static preset if static flag is set
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Nov 8, 2024
1 parent f9c269f commit fdb68f2
Showing 1 changed file with 7 additions and 5 deletions.
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

0 comments on commit fdb68f2

Please sign in to comment.