
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@piraces/eleventy-plugin-pwa
Advanced tools
An Eleventy plugin to generate service worker for PWA using Google Workbox
An Eleventy plugin to generate service worker. Using Google Workbox to generate service-worker.js based on your
dir.output.
This is a fork of the original work of @okitavera in eleventy-plugin-pwa, providing up-to-date support with the latest versions of Workbox, Eleventy and other related dependencies (in order to use the latest features and advancements of these tools).
npm i @piraces/eleventy-plugin-pwa
const pluginPWA = require("@piraces/eleventy-plugin-pwa");
module.exports = function(eleventyConfig) {
eleventyConfig.addPlugin(pluginPWA);
};
Read more about Eleventy plugins
// in your header templates
<script>
if ("serviceWorker" in navigator)
navigator.serviceWorker.register("/service-worker.js");
</script>
Read The Web App Manifest Guide
You can also pass workbox generateSW options directly into the plugin. For example :
// overwriting destination file and more
const pluginPWA = require("@piraces/eleventy-plugin-pwa");
module.exports = function(eleventyConfig) {
eleventyConfig.addPlugin(pluginPWA, {
swDest: "./build/sw.js",
globDirectory: "./build"
});
};
Read more about it on workbox generateSW module page
This code is available under the MIT license.
FAQs
An Eleventy plugin to generate service worker for PWA using Google Workbox
We found that @piraces/eleventy-plugin-pwa 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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.