Skip to content

@unplugin-pwa/core ​

The bundler-agnostic foundation of unplugin-pwa. It contains the shared PWA logic (configuration resolution, Web App Manifest, service worker registration, virtual modules, PWA assets and inspector utilities) with no dependency on any specific bundler.

💡 Note: This package is aimed at integration authors. If you just want to add PWA support to your app, use an integration such as @unplugin-pwa/vite instead.

What's Inside? ​

Each area is exposed as its own subpath export, so you only import what you need and everything stays tree-shakable.

AreaSubpaths
Configuration and contextconfig, context, context-types, constants, prepare-pwa-context, prepare-sw-names
Web App Manifestgenerate-web-manifest, create-web-manifest-html-link, inject-web-manifest-html-link
Service worker registrationgenerate-register-sw, create-generate-register-sw-script, inject-generate-register-sw, generate-virtual-module
Service worker utilitiesadditional-manifest-entries, dual-sw-utilities, build-pwa-asset
Developmentdev/prepare-sw-names-and-glob-directory, dev/prepare-temp-folder
PWA Assetspwa-assets/* (build, config, dev, generator, html, manifest, options, types, utils)
Inspectorinspector-utils, resolve-inspector-dist
Mischtml, helpers, logs

Client Types ​

The virtual module and framework type declarations also live here, shared by all integrations:

SubpathUse it for
@unplugin-pwa/core/clientVirtual modules (base)
@unplugin-pwa/core/vanillajsVanilla JavaScript
@unplugin-pwa/core/vueVue 3
@unplugin-pwa/core/reactReact
@unplugin-pwa/core/react-legacyReact (legacy)
@unplugin-pwa/core/preactPreact
@unplugin-pwa/core/solidSolidJS
@unplugin-pwa/core/svelteSvelte
@unplugin-pwa/core/infovirtual:pwa-info
@unplugin-pwa/core/pwa-assetsPWA Assets virtual modules
json
{
  "compilerOptions": {
    "types": ["@unplugin-pwa/core/vue"]
  }
}

Requirements ​

@unplugin-pwa/core requires Node 22.14.0 or above.

The following peer dependencies are all optional; install them only if your integration needs them:

  • Vite: from 3.1 to 8.
  • Rolldown: 1.0.0 or above.
  • @vite-pwa/assets-generator: 1.x or 2.x, only when using PWA Assets.

Install ​

bash
pnpm add -D @unplugin-pwa/core
bash
yarn add -D @unplugin-pwa/core
bash
npm i -D @unplugin-pwa/core

Released under the MIT License.