Skip to content

Commit 021824d

Browse files
committed
fix(module): correctly filter vite plugins
1 parent 3f58b11 commit 021824d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/module/plugins/mock.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ export const createMockPlugin = (ctx: MockPluginContext) => createUnplugin(() =>
260260
const plugins = (config.plugins || []) as Plugin[]
261261

262262
// `vite:mocks` was a typo in Vitest before v0.34.0
263-
const vitestPlugins = plugins.filter(p => (p.name === 'vite:mocks' || p.name.startsWith('vitest:')) && (p.enforce || ('order' in p && p.order === 'post')))
263+
const vitestPlugins = plugins.filter(p => (p.name === 'vite:mocks' || p.name.startsWith('vitest:')) && (p.enforce || ('order' in p && p.order)) === 'post')
264264
const lastNuxt = findLastIndex(
265265
plugins,
266266
i => i.name?.startsWith('nuxt:'),

0 commit comments

Comments
 (0)