Skip to content

Commit

Permalink
fix(module): correctly filter vite plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Apr 17, 2024
1 parent 3f58b11 commit 021824d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/module/plugins/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ export const createMockPlugin = (ctx: MockPluginContext) => createUnplugin(() =>
const plugins = (config.plugins || []) as Plugin[]

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

0 comments on commit 021824d

Please sign in to comment.