UNPKG

webapp-astro-pwa

Version:

A ready-to-use Astro component library for adding Progressive Web App (PWA) support to your Astro projects. This package provides drop-in components and utilities for manifest injection, service worker registration, install prompts, and more. Includes a w

14 lines (11 loc) 398 B
const globPath = process.env.SW_DIST_PATH; if (!globPath) { console.error("SW_DIST_PATH not specified. Check your npm build script"); return; } module.exports = { globDirectory: globPath, globPatterns: ["**/*.{css,png,webp,avif,mp4,html,ico,woff2,json,js,svg,xml,txt}"], swDest: `${globPath}/sw.js`, swSrc: "./node_modules/webapp-astro-pwa/src/pwa/sw.js", // Our custom sw.js file };