Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
fix(kit): only call viteExtendConfig callback once if possible (#5929)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Jul 15, 2022
1 parent 78d4eab commit a54925f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/kit/src/build.ts
Expand Up @@ -99,6 +99,11 @@ export function extendViteConfig (
return
}

if (options.server !== false && options.client !== false) {
// Call fn() only once
return nuxt.hook('vite:extend', ({ config }) => fn(config))
}

nuxt.hook('vite:extendConfig', (config, { isClient, isServer }) => {
if (options.server !== false && isServer) {
return fn(config)
Expand Down

0 comments on commit a54925f

Please sign in to comment.