diff --git a/packages/kbn-storybook/src/webpack.config.ts b/packages/kbn-storybook/src/webpack.config.ts index f0040ad001669..3cda40f2beb12 100644 --- a/packages/kbn-storybook/src/webpack.config.ts +++ b/packages/kbn-storybook/src/webpack.config.ts @@ -133,6 +133,9 @@ export default function ({ 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 ?? []) {