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
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Jul 15, 2022
1 parent 78d4eab commit 987cb1f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/kit/src/build.ts
Original file line number Diff line number Diff line change
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 987cb1f

Please sign in to comment.