Fix storybook config (#182283)

Storybook is attempting to load an esm after the merge of #182244. This
updates the webpack configuration to only load files from the browser
and main properties.
This commit is contained in:
Jon 2024-05-01 14:35:08 -05:00 committed by GitHub
parent 24e5b3a4bc
commit 869402b831
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -139,6 +139,9 @@ export default ({ config: storybookConfig }: { config: Configuration }) => {
stats,
};
// Override storybookConfig mainFields instead of merging with config
delete storybookConfig.resolve?.mainFields;
const updatedModuleRules = [];
// clone and modify the module.rules config provided by storybook so that the default babel plugins run after the typescript preset
for (const originalRule of storybookConfig.module?.rules ?? []) {