---
title: microFrontend
---

# deploy.microFrontend

- **Type:** `object`
- **Default:** `{ enableHtmlEntry: true, externalBasicLibrary: false }`

```ts
interface MicroFrontend {
  enableHtmlEntry?: boolean;
  externalBasicLibrary?: boolean;
  moduleApp?: string;
}
```

Developers can configure micro-frontend sub-application information using the `deploy.microFrontend` object.

:::caution
To enable the "Micro Frontend" features, run `pnpm run new` first.

:::

## Example

```ts
export default defineConfig({
  deploy: {
    microFrontend: {
      enableHtmlEntry: true,
    },
  },
});
```

## Configuration

### enableHtmlEntry

- **Type:** `boolean`
- **Default:** `true`

Specifies whether to enable the HTML entry. By default, it is set to `true`, which means the sub-application is built in `HTML` mode. Garfish supports the `html` entry, so you can enable this option to experience the corresponding features. When using the HTML entry, simply point the sub-application entry to the HTML file.

Set it to `false` to indicate that the sub-application is built as `js`. After building the sub-application as `js`, it cannot run independently. When using the `JS` entry, point the entry file of the sub-application to the `JS` file of the sub-application.

### externalBasicLibrary

- **Type:** `boolean`
- **Default:** `false`

Specifies whether to use the external base library. When set to `true`, the current child application will be externalized for `react` and `react-dom`. The main application of Modern.js will automatically `setExternal` these two base libraries. If you are using other frameworks, please add `react` and `react-dom` dependencies through `Garfish.setExternal`.
