Skip to content

Commit 7631afe

Browse files
committed
chore(storybook-builder): group prebundle candidates by purpose
1 parent cdd151b commit 7631afe

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

packages/storybook-builder/src/rollup-plugin-prebundle-modules.ts

+6-9
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ function getModules() {
6666
// builder-vite bundles different dependencies for performance reasons
6767
// we aim only at browserifying NodeJS dependencies (CommonJS/process.env/...)
6868
export const CANDIDATES = [
69+
/* for different packages */
70+
'tiny-invariant',
71+
72+
/* for @storybook/addon-interactions */
73+
'jest-mock',
6974
// @testing-library has ESM, but imports/exports are not working correctly between packages
7075
// specifically "@testing-library/user-event" has "dist/esm/utils/misc/getWindow.js" (see https://cdn.jsdelivr.net/npm/@testing-library/[email protected]/dist/esm/utils/misc/getWindow.js)
7176
// which uses "@testing-library/dom" in `import { getWindowFromNode } from '@testing-library/dom/dist/helpers.js';`
@@ -74,15 +79,7 @@ export const CANDIDATES = [
7479
'@testing-library/dom',
7580
'@testing-library/user-event',
7681

77-
// CommonJS module used in Storybook MJS files
82+
/* for @storybook/addon-docs */
7883
'doctrine',
79-
80-
// CommonJS module used in Storybook MJS files
81-
'jest-mock',
82-
83-
// CommonJS module used in Storybook MJS files
8484
'lodash/mapValues.js',
85-
86-
// ESM, but uses `process.env.NODE_ENV`
87-
'tiny-invariant',
8885
];

0 commit comments

Comments
 (0)