Setup guide · Vue
Turn a Vue 3 app into an installable PWA (2026)
Vue 3 PWA setup — manifest, service worker, install prompt. Works with Vue CLI, Vite and Nuxt.
Key takeaways
- Vite + vite-plugin-pwa is the modern default.
- The Vue CLI PWA plugin still works for legacy projects.
- Use a hosted install popup to avoid managing prompt state in Pinia.
Before you start
- Vue 3
- Vite or Vue CLI
- HTTPS origin
manifest.webmanifest
{
"name": "Your product",
"short_name": "Product",
"start_url": "/",
"display": "standalone",
"background_color": "#ffffff",
"theme_color": "#111827",
"icons": [
{ "src": "/icon-192.png", "sizes": "192x192", "type": "image/png" },
{ "src": "/icon-512.png", "sizes": "512x512", "type": "image/png", "purpose": "any maskable" }
]
}Step-by-step for Vue
- Step 1Add vite-plugin-pwa
For Vite: install and add to plugins.
- Step 2Configure the manifest
Pass the manifest inline. The plugin writes it at build time.
- Step 3Add the install popup
Drop the InstantPWA script into index.html.
Minimal sw.js
// public/sw.js
self.addEventListener('install', (e) => self.skipWaiting());
self.addEventListener('activate', (e) => self.clients.claim());
self.addEventListener('fetch', () => {});Common Vue gotchas
- If you use Vue Router with history mode, make sure your host serves index.html for unknown routes — otherwise the installed app 404s on deep links.
FAQ
Do I need a native app if my Vue site is a PWA?
No. Once your Vue site meets the three PWA criteria (HTTPS, a manifest, a service worker), Chromium browsers offer to install it and iOS Safari 16.4+ supports the full standalone experience — including web push.
Will a service worker slow my Vue site down?
Not measurably on first load. The worker installs asynchronously after the page becomes interactive. On repeat visits it typically improves LCP and TTFB because assets are served from cache.
Can I still deploy my Vue site to Vercel, Netlify or Cloudflare?
Yes. Any static or edge host works — the manifest and service worker are plain files served from the origin. No build-time integration is required.
Skip the setup — drop in one line
InstantPWA handles the install prompt across iOS, Android and desktop. Free forever for one popup.
Get started free