Skip to content

Commit

Permalink
Merge pull request #29617 from storybookjs/yann/fix-dep-optimization-…
Browse files Browse the repository at this point in the history
…issue

Addon Test: Only optimize react deps if applicable in vitest-plugin
  • Loading branch information
yannbf authored Nov 14, 2024
2 parents 28b94f8 + 7e4d45a commit b3a9dfd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions code/addons/test/src/vitest-plugin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ export const storybookTest = (options?: UserOptions): Plugin => {
config.optimizeDeps ??= {};
config.optimizeDeps = {
...config.optimizeDeps,
include: [
...(config.optimizeDeps.include ?? []),
'react-dom/test-utils',
'@storybook/experimental-addon-test/**',
],
include: [...(config.optimizeDeps.include ?? []), '@storybook/experimental-addon-test/**'],
};

if (frameworkName?.includes('react') || frameworkName?.includes('nextjs')) {
config.optimizeDeps.include.push('react-dom/test-utils');
}

if (frameworkName?.includes('vue3')) {
config.define ??= {};
config.define.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = 'false';
Expand Down

0 comments on commit b3a9dfd

Please sign in to comment.