Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
astrojs-service-worker
Advanced tools
An Astro integration to generate a Service Worker. Powered by Workbox.
An Astro integration to generate a Service Worker. Powered by Workbox.
A minimal wrapper around Workbox to quickly add a service worker to your Astro static site. Get precached pages and offline support out of the box.
Coming Soon!
npm install astrojs-service-worker
or yarn add astrojs-service-worker
astrojs-service-worker
to your astro.config.mjs integrations:import { defineConfig } from "astro/config";
+ import serviceWorker from "astrojs-service-worker";
export default defineConfig({
+ integrations: [serviceWorker()],
});
Name | Description | Type |
---|---|---|
registration.autoRegister |
Autoregister the service worker. If
Defaults to | boolean | undefined |
workbox |
Options passed to `worbox-build`. See all available configuration options [here](https://developer.chrome.com/docs/workbox/modules/workbox-build/)
Defaults to Note: | InjectManifestOptions | GenerateSWOptions |
You must serve your application over HTTPS in production environments. Service Workers must be served from the site's origin over HTTPS.
Some browsers special case localhost
, so this is may not necessary during local development. HTTPS is not handled by this library.
The service worker origin constraint means that service workers can not control pages on a different subdomain. Eg mysite.com
can not be controlled by a service worker if that was served from a subdomain such as mycdn.mysite.com
.
PR's and issues welcomed! For more guidance check out CONTRIBUTING.md
See the project's MIT License.
FAQs
An Astro integration that generates a Service Worker. Powered by Workbox.
We found that astrojs-service-worker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.