From 869402b831858240250ceb89bee1929f6cca074c Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 1 May 2024 14:35:08 -0500 Subject: [PATCH] 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. --- packages/kbn-storybook/src/webpack.config.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/kbn-storybook/src/webpack.config.ts b/packages/kbn-storybook/src/webpack.config.ts index 282a41dcbd453..12f419f4d32db 100644 --- a/packages/kbn-storybook/src/webpack.config.ts +++ b/packages/kbn-storybook/src/webpack.config.ts @@ -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 ?? []) {