From 2061c383cc87d90ad3b74d4497da4ba1467851f5 Mon Sep 17 00:00:00 2001 From: m0nch1 Date: Mon, 1 Jul 2024 00:03:53 +0900 Subject: [PATCH] fix: optimize deps with nested config --- src/module.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/module.ts b/src/module.ts index 05165a5..6f15e92 100644 --- a/src/module.ts +++ b/src/module.ts @@ -303,7 +303,9 @@ export default defineNuxtModule({ 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']