Skip to content

Commit

Permalink
fix: allow both config file + vite config
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Feb 16, 2022
1 parent 8a088e2 commit c275413
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/histoire/src/node/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,10 @@ export async function resolveConfig (cwd: string = process.cwd()): Promise<Histo
const configFile = resolveConfigFile(cwd)
if (configFile) {
result = await loadConfigFile(configFile)
} else {
const viteConfig = await resolveViteConfig({}, 'serve')
result = viteConfig.histoire ?? {}
}
return processConfig(defu(result, getDefaultConfig()))
const viteConfig = await resolveViteConfig({}, 'serve')
const viteHistoireConfig = (viteConfig.histoire ?? {}) as HistoireConfig
return processConfig(defu(result, viteHistoireConfig, getDefaultConfig()))
}

export function processConfig (config: HistoireConfig): HistoireConfig {
Expand Down

0 comments on commit c275413

Please sign in to comment.