Skip to content

Commit

Permalink
fix(nuxt): stable optimizeDeps augmenting
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Dec 13, 2023
1 parent 286c357 commit 98985a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .vscode/settings.json
Expand Up @@ -33,8 +33,8 @@

// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.organizeImports": false
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
},

// Silent the stylistic rules in you IDE, but still auto fix them
Expand Down
5 changes: 4 additions & 1 deletion packages/nuxt/index.ts
Expand Up @@ -75,7 +75,10 @@ export default defineNuxtModule<VueUseNuxtOptions>({
nuxt.hook('vite:extend', ({ config }: any) => {
config.optimizeDeps = config.optimizeDeps || {}
config.optimizeDeps.exclude = config.optimizeDeps.exclude || []
config.optimizeDeps.exclude.push(...fullPackages)
for (const pkg of fullPackages) {
if (!config.optimizeDeps.exclude.includes(pkg))
config.optimizeDeps.exclude.push(pkg)
}
})

// add packages to transpile target for alias resolution
Expand Down

0 comments on commit 98985a4

Please sign in to comment.