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 ?? []) {