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

fix(kit): only call viteExtendConfig callback once if possible #5929

Merged
merged 1 commit into from Jul 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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))
pi0 marked this conversation as resolved.
Show resolved Hide resolved
}

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