html.appIcon
- Type:
- 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
iconsfield. - Generate the apple-touch-icon and
manifesttags in the HTML file.
Refer to the following documents for more information:
Example
For display on different devices, you will need to prepare several icons of different sizes.
The most commonly used icon sizes are 192x192 and 512x512, and you can customize the icon sizes and quantities to suit your needs.
After compilation, the following tags will be automatically generated in the HTML:
Here, manifest.webmanifest is a JSON file that contains information about the application's name, icons, and other details.
For Chromium, you must provide at least a 192x192 pixel icon and a 512x512 pixel icon. If only those two icon sizes are provided, Chrome automatically scales the icons to fit the device. If you'd prefer to scale your own icons, and adjust them for pixel-perfection, provide icons in increments of 48dp.
name
- Type:
string - Default:
undefined
The name of the application that will be displayed when it is added to the home screen of the mobile device. If not set, the manifest.webmanifest file will not be generated.
For more details, see Web app manifests - name.
icons
- Type:
AppIconItem[] - Default:
undefined
The list of icons:
srcis the path of the icon, which can be a URL, an absolute file path, or a relative path to the project root.sizeis the size of the icon in pixels.targetrefers to the intended target for the icon, which can be eitherapple-touch-iconorweb-app-manifest. Iftargetis not set, by default, the manifest file will include all icons, while theapple-touch-icontags will only include icons smaller than200x200.purposeis a case-sensitive keyword string that specifies one or more contexts in which the icon can be used by the browser or operating system. This field is only effective when thetargetis'web-app-manifest'. See MDN - purpose for more details.
Example
src can be set to an absolute path:
Use target to specify the target for the icon:
filename
- Type:
string - Default:
'manifest.webmanifest'
The filename of the manifest file.

