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

Commit

Permalink
chore: migrate to server.deps.inline
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Aug 14, 2023
1 parent 667f825 commit 13ea9b3
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions packages/nuxt-vitest/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,20 +121,24 @@ export async function getVitestConfigFromNuxt(
['{test,tests}/nuxt/**.*', 'nuxt'],
...(options.viteConfig.test?.environmentMatchGlobs || []),
],
deps: {
...options.viteConfig.test?.deps,
inline: [
// vite-node defaults
/\/node_modules\/(.*\/)?(nuxt|nuxt3)\//,
/^#/,
// additional deps
'vitest-environment-nuxt',
...(options.nuxt.options.build.transpile.filter(
r => typeof r === 'string' || r instanceof RegExp
) as Array<string | RegExp>),
...(typeof options.viteConfig.test?.deps?.inline !== 'boolean' ? typeof options.viteConfig.test?.deps?.inline : []),
],
},
server: {
...options.viteConfig.test?.server || [],
deps: {
...options.viteConfig.test?.server?.deps || [],
inline: [
...options.viteConfig.test?.server?.deps?.inline === true ? [] : (options.viteConfig.test?.server?.deps?.inline || []),
// vite-node defaults
/\/node_modules\/(.*\/)?(nuxt|nuxt3)\//,
/^#/,
// additional deps
'vitest-environment-nuxt',
...(options.nuxt.options.build.transpile.filter(
r => typeof r === 'string' || r instanceof RegExp
) as Array<string | RegExp>),
...(typeof options.viteConfig.test?.deps?.inline !== 'boolean' ? typeof options.viteConfig.test?.deps?.inline : []),
],
},
}
},
}
}
Expand Down

0 comments on commit 13ea9b3

Please sign in to comment.