Migrations
When migrating from one version to a new one, you should remove all the PWA assets generated previously and generate them again after upgrading @vite-pwa/assets-generator package.
WARNING
If you're using some of the old PWA assets in your application, don't remove them.
Remember to check the changes before upgrading to a new version in your local environment:
- start the current version in your local server, opening your application to check the old PWA assets
- upgrade the package to the new version and regenerate the PWA assets
- start the new version in your local server, refresh your application to check the new PWA assets
From v0.1.0 to v0.2.0
The api and the core has been built from scratch, the CLI has been rebuilt on top of the API.
The main changes included in version v0.2.0 are:
generatePWAImageAssetsandgeneratePWAAssetsfunctions have been removed from@vite-pwa/assets-generatorpackage export: now the package only export types and some utilities.- new
@vite-pwa/assets-generator/api/instructionspackage export: newinstructionsfunction to collect the icon assets instructions. - new
@vite-pwa/assets-generator/api/generate-assetspackage export: newgenerateAssetsfunction to generate icon assets from an instruction. - new
@vite-pwa/assets-generator/api/generate-html-markuppackage export: newgenerateHtmlMarkupfunction to generate all html head links from an instruction. - new
@vite-pwa/assets-generator/api/generate-manifest-icons-entrypackage export: newgenerateManifestIconsEntryfunction to generate the PWA web manifest icons' entry. - new CLI options for html head links generation:
xhtmlandincludeId.
If you are using generatePWAImageAssets and/or generatePWAAssets functions, you need to update your code to use the new instructions and generateAssets functions.
If you're only using the CLI, you don't need to change anything.
For more details about the new version v0.2.0, check this comment in the repository.
From minimal to minimal-2023 Preset
If you are using pwa-assets-generator in your package.json scripts, update the script from:
"generate-assets": "pwa-assets-generator --preset minimal <your-logo-path>"to:
"generate-assets": "pwa-assets-generator --preset minimal-2023 <your-logo-path>"If you are using a configuration file:
- update the built-in preset name or update the import to use
minimal2023Preset: check the code snippets in the built-in features section. - include
headLinkOptions.preset = '2023'in you configuration file
The new minimal-2023 preset changes only the favicon.ico size, the apple-touch-icon and PWA manifest icons are the same, you need to update your html head favicon entries, from:
<head>
<link rel="icon" href="/favicon.ico" sizes="any">
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
</head>to:
<head>
<link rel="icon" href="/favicon.ico" sizes="48x48">
<link rel="icon" href="/favicon.svg" sizes="any" type="image/svg+xml">
</head>