File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,17 +13,17 @@ import { iconsSpritesheet } from 'vite-plugin-icons-spritesheet'
1313export default defineConfig ( ( config ) => {
1414 const mode = config . mode ?? process . env . NODE_ENV
1515 const isTest = mode === 'test' || Boolean ( process . env . VITEST )
16- const cacheServerStubPlugin = isTest
17- ? {
18- name : 'vitest-cache-server-stub' ,
19- resolveId ( source : string ) {
20- if ( source . endsWith ( 'cache.server.ts' ) ) {
21- return path . resolve ( 'tests/mocks/cache-server.ts' )
22- }
23- return null
24- } ,
16+ const cacheServerStubPlugin = {
17+ name : 'vitest-cache-server-stub' ,
18+ enforce : 'pre' as const ,
19+ resolveId ( source : string ) {
20+ if ( ! process . env . VITEST ) return null
21+ if ( source . endsWith ( 'cache.server.ts' ) ) {
22+ return path . resolve ( 'tests/mocks/cache-server.ts' )
2523 }
26- : null
24+ return null
25+ } ,
26+ }
2727 return {
2828 build : {
2929 target : 'es2022' ,
You can’t perform that action at this time.
0 commit comments