Repository: storybook
Issue: [Bug]: Doc Blocks missing after using @storybook/angular:build-storybook
Labels: bug,needs triage

### Describe the bug

Hello all.
 I have a bunch of stories with mdx files, and when running locally everything works as expected. I can browse the custom docs from mdx and stories for the components (I can see Docs in the menu under each components entry).

Now when using @storybook/angular:build-storybook builder to get static assets, and hosting them on our server, the Docs entry is gone. It feels like mdx are ignored in the build.

No concrete errors in the console.

### Reproduction link

Not available

### Reproduction steps

Not available as this is build and deployment related.

### System

```bash
npmPackages:
    @storybook/addon-a11y: ^8.2.8 => 8.2.9
    @storybook/addon-actions: ^8.2.8 => 8.2.9
    @storybook/addon-designs: ^8.0.3 => 8.0.3
    @storybook/addon-docs: ^8.2.8 => 8.2.9
    @storybook/addon-essentials: ^8.2.8 => 8.2.9
    @storybook/addon-interactions: ^8.2.8 => 8.2.9
    @storybook/addon-links: ^8.2.8 => 8.2.9
    @storybook/angular: ^8.2.8 => 8.2.9
    @storybook/blocks: ^8.2.8 => 8.2.9
    @storybook/preset-scss: ^1.0.3 => 1.0.3
    @storybook/test: ^8.2.8 => 8.2.9
    chromatic: ^11.3.1 => 11.7.0
    eslint-plugin-storybook: ^0.8.0 => 0.8.0
    storybook: ^8.2.8 => 8.2.9

    @angular/common: 17.0.8,
    @angular/compiler: 17.0.8,
    @angular/core: 17.0.8,
```


### Additional context

Using angular v17

Build config **angular.json**
```
"build-storybook": {
          "builder": "@storybook/angular:build-storybook",
          "options": {
            "configDir": ".storybook",
            "browserTarget": "{mypage}:build",
            "outputDir": "dist/storybook/{mypage}"
          }
        },
```

**main.js**  storybook config
```
module.exports = {
  stories: ['../src/app/**/*.mdx', '../src/app/**/*.stories.@(js|jsx|ts|tsx)'],

  addons: [
    '@storybook/addon-links',
    '@storybook/addon-essentials',
    '@storybook/addon-interactions',
    '@storybook/addon-a11y',
    '@storybook/addon-designs',
    '@storybook/preset-scss',
    '@storybook/addon-docs',
  ],

  framework: {
    name: '@storybook/angular',
    options: {},
  },
  features: {
    interactionsDebugger: true,
  },
  test: {
    disableBlocks: false,
    disableMDXEntries: false,
  }
};
```

Example Story **badge.component.stories.ts**:
```
export default {
  title: 'Components/badge',
  component: BadgeComponent,
  decorators: [
    moduleMetadata({
      declarations: [IconComponent],
    }),
  ],
  parameters: {
    docs: {
      description: {
        component: 'Badge component',
      },
    },
  },
  argTypes: {
    label: {
      control: {
        type: 'text',
      },
    },
    size: {
      options: [Sizes.sm, Sizes.md, Sizes.lg],
      control: {
        type: 'radio',
      },
    },
    color: {
      options: [
        Colors.primary,
        Colors.light,
        Colors.green,
        Colors.red,
        Colors.grey,
      ],
      control: {
        type: 'radio',
      },
    },
  },
} as Meta<BadgeComponent>;

export const Default: StoryObj<BadgeComponent> = {
  args: {
    icon: 'bell',
    label: 'Badge',
    size: 'md',
  },
};

```
Example markdown file **badge.component.mdx**

```
import {
  Canvas,
  Controls,
  Description,
  Meta,
  Story,
  Subtitle,
} from '@storybook/blocks';

import * as BadgeStories from './badge.component.stories.ts';
import { BadgeComponent } from './badge.component.ts';

<Meta of={BadgeStories} title='badge' component={HvBadgeComponent}/>

<Subtitle>component: ___hv-badge.component.ts___ <br/>selector: ___app-hv-badge___</Subtitle>
Badge component.

<Controls />
```