The PWA (Progressive Web App) feature lets your Laioutr frontend behave like a native app: users can install it on their phone or desktop, open it from the home screen or app list, and in many cases use it offline thanks to cached assets and pages. Browsers that support PWA will show an “Add to Home Screen” or “Install app” option when your site meets the required criteria (HTTPS, valid web app manifest, and a registered service worker).
Laioutr’s PWA support is provided by the @laioutr-app/pwa package. It wires in Vite PWA (via @vite-pwa/nuxt) with sensible defaults so you get a working PWA with minimal configuration. You can override manifest, caching, and update behavior to match your brand and requirements.
No orchestr, analytics, or backend is added; the feature is purely about making your existing frontend installable and offline-capable.
Add the PWA app to your Nuxt modules. In nuxt.config.ts or via your Laioutr project config (e.g. laioutrrc.json):
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['@laioutr-app/pwa', '@laioutr-core/frontend-core'],
});
Once the module is enabled, it merges its default PWA config with any options you pass under @laioutr-app/pwa (or under pwa in Nuxt config). The underlying @vite-pwa/nuxt module is installed automatically. Ensure your app is served over HTTPS in production so the service worker and install flow work.
Configuration is optional. The module ships with defaults that work out of the box; you only need to change them to customize name, icons, theme, caching, or update strategy.
@laioutr-app/pwa key (or pwa) and set the same options. Options are merged with the module’s defaults.All options are the same as those supported by Vite PWA / @vite-pwa/nuxt; the Laioutr app simply provides defaults and forwards your config to that module.
| Area | What it does | Default (Laioutr) |
|---|---|---|
| Manifest | App name, short name, theme color, icons shown when installed and in the task switcher. | Name: "Laioutr App", short_name: "LaioutrApp", theme_color: "#ffffff", icons: 192×192 and 512×512 (you should replace with your own). |
| Register type | When the service worker updates: autoUpdate = use new version on next reload; prompt = ask the user to reload. | autoUpdate |
| Workbox | What to cache and how. navigateFallback = fallback URL for offline navigation; globPatterns = which file types to precache. | navigateFallback: "/", globPatterns: JS, CSS, HTML, PNG, SVG, ICO. |
| Client / install prompt | Whether to enable the API for showing an install prompt from your UI. | true |
| Dev options | Whether to enable PWA in development (e.g. for testing the service worker). | enabled: true, type: "module" |
Replace the default icons (e.g. pwa-192x192.png, pwa-512x512.png) with your own in public/ and reference them in the manifest, or override the full manifest object. Similarly, set name, short_name, and theme_color to match your brand.
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['@laioutr-app/pwa'],
'@laioutr-app/pwa': {
manifest: {
name: 'My Store',
short_name: 'MyStore',
theme_color: '#1a1a2e',
icons: [
{ src: '/icons/icon-192.png', sizes: '192x192', type: 'image/png' },
{ src: '/icons/icon-512.png', sizes: '512x512', type: 'image/png' },
],
},
registerType: 'autoUpdate',
// workbox, client, devOptions, etc. can be overridden here as needed
},
});
Place your icon files in public/icons/ (or the paths you use in the manifest). For full option reference, see the Vite PWA documentation.
pwa-192x192.png and pwa-512x512.png; add these to public/ or override manifest.icons with your paths.