html.appIcon

  • Type:
type AppIconItem = {
  src: string;
  size: number;
  target?: 'apple-touch-icon' | 'web-app-manifest';
};

type AppIcon = string | {
  name?: string;
  icons: AppIconItem[];
  filename?: string;
};
  • Default: undefined

Set the web application icons to display when added to the home screen of a mobile device:

  • Generate the web app manifest file and its icons field.
  • Generate the apple-touch-icon and manifest tags in the HTML file.

AppIcon string

The appIcon configuration of type string is a syntactic sugar for the object type.

export default {
  html: {
    appIcon: './src/assets/icon.png',
  },
};

The above configuration is equivalent to the following configuration:

export default {
  html: {
    appIcon: { icons: [{ src: './src/assets/icon.png', size: 180 }] }
  },
};
INFO

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

ON THIS PAGE