Skip to content

Commit

Permalink
fix: optimize deps with nested config
Browse files Browse the repository at this point in the history
  • Loading branch information
m0nch1 committed Jun 30, 2024
1 parent ca050fa commit 2061c38
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,9 @@ export default defineNuxtModule<GqlConfig>({
await generateGqlTypes()

nuxt.hook('vite:extendConfig', (config, { isServer }) => {
config.optimizeDeps?.include?.push('graphql-request')
config.optimizeDeps = config.optimizeDeps || {};
config.optimizeDeps.include = config.optimizeDeps.include || [];
config.optimizeDeps.include.push('nuxt-graphql-request > graphql-request');

if (isServer && config.define?.['typeof document']) {
delete config.define['typeof document']
Expand Down

0 comments on commit 2061c38

Please sign in to comment.