|
The vite plus docs say
The documentation makes it sound like the primary reason for this is just developer ergonomics. Are there any problems a separate vitest config would cause other than having configs in multiple places? The reason why I'm asking is that nuxt requires that you put vite configuration in a What would be the consequences of configuring things like this? For context, this is used as a monorepo where the root uses vite plus with a package that uses nuxt. |
Replies: 1 comment 1 reply
|
@finleyjb I wouldn't try to squeeze the Nuxt package into The Vite+ recommendation is mainly about its built-in {
"scripts": {
"test": "vitest"
}
}// vitest.config.ts
import { defineVitestConfig } from '@nuxt/test-utils/config'
export default defineVitestConfig({
test: {
environment: 'nuxt',
},
})That should coexist fine with Vite+ at the monorepo root. This package just won't pick up test settings from the root |
@finleyjb I wouldn't try to squeeze the Nuxt package into
vite.config.ts. Nuxt still expects avitest.config.tsusing@nuxt/test-utils/config, so it's fine to let that package be the exception.The Vite+ recommendation is mainly about its built-in
vp testcommand, since that reads thetestblock fromvite.config.ts. For the Nuxt workspace, I'd use a normal package script and run it withvp run test:{ "scripts": { "test": "vitest" } }That should coexist fine with Vite+ at the monorepo root. This package just won't pick up…