For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /configure/app/html/meta.md.

html.meta

  • Type: Object | Function
  • Default:
const defaultMeta = {
  charset: { charset: 'utf-8' },
  viewport: 'width=device-width, initial-scale=1',
};

Configure the <meta> tag of the HTML.

The default viewport allows users to zoom the page. If your app needs to fill the screen or disable automatic telephone number detection, configure those behaviors explicitly:

modern.config.ts
import { defineConfig } from '@modern-js/app-tools';

export default defineConfig({
  html: {
    meta: {
      viewport: 'width=device-width, initial-scale=1, viewport-fit=cover',
      'format-detection': 'telephone=no',
    },
  },
});

Setting viewport replaces the entire default string, so include width=device-width and initial-scale=1 when customizing it. When using viewport-fit=cover, account for the device's safe areas in your page styles.

Info

The usage of this configuration item is exactly the same as that of Rsbuild. For detailed information, please refer to Rsbuild - html.meta.