From 42bd4a2593b141492c60537a13fbae3deec2d19d Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Wed, 3 Jul 2024 21:02:03 +0200 Subject: [PATCH] fix: include pretty-format in @vitest/runner for optimization on npm Fixes #6023 --- packages/browser/src/node/plugin.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/browser/src/node/plugin.ts b/packages/browser/src/node/plugin.ts index 5d1489bea274..69b72649597b 100644 --- a/packages/browser/src/node/plugin.ts +++ b/packages/browser/src/node/plugin.ts @@ -158,6 +158,9 @@ export default (browserServer: BrowserServer, base = '/'): Plugin[] => { return { define, + resolve: { + dedupe: ['vitest'], + }, optimizeDeps: { entries, exclude: [ @@ -188,6 +191,7 @@ export default (browserServer: BrowserServer, base = '/'): Plugin[] => { 'vitest > pretty-format > ansi-regex', 'vitest > chai', 'vitest > chai > loupe', + 'vitest > @vitest/runner > pretty-format', 'vitest > @vitest/utils > diff-sequences', 'vitest > @vitest/utils > loupe', '@vitest/browser > @testing-library/user-event',