Skip to content

Commit 04f0d31

Browse files
committed
Fix module resolution in storybook
Followup to #10386
1 parent 6fd0d87 commit 04f0d31

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.storybook/main.cjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ module.exports = {
4545
};
4646

4747
// These should be sync'd with the config in `webpack.config.cjs`.
48+
49+
config.resolve = {
50+
// Fixes resolving packages in the monorepo so we use the "src" folder, not "dist".
51+
// TODO: Revisit after upgrading to webpack v5 or when splitting repository.
52+
mainFields: ['browser', 'module', 'main', 'source'],
53+
};
54+
4855
config.module.rules.unshift(
4956
{
5057
test: /\.svg$/,

0 commit comments

Comments
 (0)