npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@vite-pwa/sveltekit

v2.0.4

Published

Zero-config PWA for SvelteKit

Readme

🚀 Features

  • 📖 Documentation & guides
  • 👌 Zero-Config: sensible built-in default configs for common use cases
  • 🔩 Extensible: expose the full ability to customize the behavior of the plugin
  • 🦾 Type Strong: written in TypeScript
  • 🔌 Offline Support: generate service worker with offline support (via Workbox)
  • ⚡ Fully tree shakable: client virtual modules are strictly optimized for Dead Code Elimination.
  • 📄 Web Manifest: auto-inject Web App Manifest and PWA assets seamlessly.
  • 💬 Prompt for new content: built-in support for Vanilla JavaScript, Vue 3, React, Svelte, SolidJS and Preact
  • ⚙️ Stale-while-revalidate: automatic reload when new content is available
  • ✨ Static assets handling: configure static assets for offline support
  • 🐞 Development Support: debug your custom service worker logic as you develop your application
  • 🔍 Inspector: visually inspect your resolved configuration, web manifest and service worker during development, via middleware or DevFrame
  • 🧩 Modular: use the ready-to-use plugins or compose your own integration from the building blocks in @unplugin-pwa/core and @unplugin-pwa/vite
  • 📦 Universal Bundlers: native integration with Vite, Rolldown, Webpack (WIP), Rspack (WIP), and Rsbuild (WIP).
  • 🛠️ Meta-Frameworks: seamless integration with îles, SvelteKit, VitePress, Astro, Nuxt 3/4/5, React Router, TanStack and Next (WIP).
  • 💥 PWA Assets Generator: generate all the PWA assets from a single command and a single source image
  • 🚀 PWA Assets Integration: serving, generating and injecting PWA Assets on the fly in your application

📦 Install

From v2.0.0, @vite-pwa/sveltekit supports SvelteKit 3 (should also support SvelteKit 1) and requires Node 22.14.0 or above.

From v0.3.0, @vite-pwa/sveltekit supports SvelteKit 2 (should also support SvelteKit 1).

From v0.2.0, @vite-pwa/sveltekit requires SvelteKit 1.3.1 or above.

npm i @vite-pwa/sveltekit -D

# yarn
yarn add @vite-pwa/sveltekit -D

# pnpm
pnpm add @vite-pwa/sveltekit -D

🦄 Usage

⚠️ v2.0.0 Breaking Changes

  • SvelteKit 3 Support: The SvelteKit integration has been completely revamped. SvelteKit v3 removes the internal $service-worker module, and v2.0.0 aligns with this new architecture.
  • API Change: The standalone SvelteKitPWA() plugin has been replaced by the withPwa wrapper, which now manages the sveltekit() plugin execution internally to correctly inject the PWA context and adapter.
  • SvelteKit >= 2.63.0: The SvelteKit team backported the ability to pass the svelte.config.js configuration directly into the SvelteKit Vite plugin. If you are using v2.63.0+ or Kit v3, you can directly use the new withPwa wrapper. The plugin automatically detects the Kit version to conditionally enable the new Vite Environment API in the PWA context without manual configuration.
  • SvelteKit < 2.63.0 with buildSW: If you are still using an older SvelteKit v2 version and opting for the buildSW strategy (formerly injectManifest), you must manually remove the service worker entry from your svelte.config.js to avoid conflicts with Kit's legacy SW behavior.
    • Legacy support (SvelteKit < 2.63.0): From v2.0.0 you cannot register the service worker at svelte.config.js anymore, use this package or use SvelteKit's built-in service worker registration.

v2.x (SvelteKit 3 & >= 2.63.0)

In v2.0.0, wrap your SvelteKit configuration using withPwa. This function automatically includes the sveltekit() plugin and all necessary @unplugin-pwa integrations.

// vite.config.js / vite.config.ts
import { withPwa } from '@vite-pwa/sveltekit'
import { defineConfig } from 'vite'

export default defineConfig({
  plugins: [
    withPwa(
      // SvelteKit options (formerly passed to sveltekit())
      {
        // ...
      },
      // PWA options
      {
        strategy: 'buildSW',
        // ...
      }
    )
  ]
})

v2.x (SvelteKit < 2.63.0)

Add LegacySvelteKitPWA plugin to vite.config.js / vite.config.ts and configure it.

// vite.config.js / vite.config.ts
import { sveltekit } from '@sveltejs/kit/vite'
import { LegacySvelteKitPWA } from '@vite-pwa/sveltekit/legacy'

export default {
  plugins: [
    sveltekit(),
    LegacySvelteKitPWA()
  ]
}

Read the 📖 v2.x documentation for a complete guide on how to configure and use this plugin.

v1.x (Legacy SvelteKit < 2.63.0)

Add SvelteKitPWA plugin to vite.config.js / vite.config.ts and configure it.

// vite.config.js / vite.config.ts
import { sveltekit } from '@sveltejs/kit/vite'
import { SvelteKitPWA } from '@vite-pwa/sveltekit'

export default {
  plugins: [
    sveltekit(),
    SvelteKitPWA()
  ]
}

Read the 📖 v1.x documentation for a complete guide on how to configure and use this plugin.

👀 Full config

Check out the type declaration src/types.ts and the following links for more details.

📄 License

MIT License © 2022-PRESENT Anthony Fu