From e722d34b6d4a69e1b7d34d3807b636ba82a4b452 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 1 Mar 2022 09:50:32 +0000 Subject: [PATCH] fix: don't override vite config (#232) --- src/module.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/module.ts b/src/module.ts index 0bb5f681..bdd766ae 100644 --- a/src/module.ts +++ b/src/module.ts @@ -1,7 +1,7 @@ import { fileURLToPath } from 'url' import defu from 'defu' import { resolve } from 'pathe' -import { defineNuxtModule, addPlugin } from '@nuxt/kit' +import { defineNuxtModule, addPlugin, extendViteConfig } from '@nuxt/kit' import type { CookieOptions } from 'nuxt3/dist/app/composables/cookie' export interface ModuleOptions { @@ -77,11 +77,11 @@ export default defineNuxtModule({ dirs.push(resolve(runtimeDir, 'composables')) }) - nuxt.options.vite = { - optimizeDeps: { - include: ['qs'] - } - } + extendViteConfig((config) => { + config.optimizeDeps = config.optimizeDeps || {} + config.optimizeDeps.include = config.optimizeDeps.include || [] + config.optimizeDeps.include.push('qs') + }) } })