Skip to content

Commit

Permalink
fix: load vite config in sequence rather than in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Feb 17, 2023
1 parent 50bfd61 commit 2a9cda8
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions packages/histoire/src/node/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,10 @@ export async function createServer (ctx: Context, options: CreateServerOptions =
}
}

const [
{ server, viteConfigFile },
{ server: nodeServer },
,
{ stop: stopMdFileWatcher },
] = await Promise.all([
getViteServer(false),
getViteServer(true),
watchStories(ctx),
createMarkdownFilesWatcher(ctx),
] as const)
const { server, viteConfigFile } = await getViteServer(false)
const { server: nodeServer } = await getViteServer(true) // Should be run after the first one to get a fresh vite.config.js
await watchStories(ctx)
const { stop: stopMdFileWatcher } = await createMarkdownFilesWatcher(ctx)

const moduleLoader = useModuleLoader({
server: nodeServer,
Expand Down

0 comments on commit 2a9cda8

Please sign in to comment.