> For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt.

# Interface: AddComponentElementConfig

控制是否为组件添加包裹元素

## Properties

### compilerOnly

> **compilerOnly**: `boolean`

是否仅在编译期添加组件元素

#### Example

注意，这仅对从 [CompatVisitorConfig.oldRuntimePkg](/next/zh/api/packages/react-rsbuild-plugin/interfaces/CompatVisitorConfig.md#oldruntimepkg) 导入的 `Component` 生效。

```js
import { defineConfig } from '@lynx-js/rspeedy'
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin'

export default defineConfig({
  plugins: [
    pluginReactLynx({
      compat: {
        addComponentElement: { compilerOnly: true }
      },
    })
  ],
})
```
