Skip to content

Add Workbox to generate a Service Worker #27

@meesrutten

Description

@meesrutten

Since every project we built with book of node includes a simple Service Worker, I want to add a standard Workbox config.

This is a working example:

module.exports = {
  "globDirectory": "public/",
  "globPatterns": [
    "**/*.{js,woff,woff2,png,svg,jpg,xml,ico,html,webmanifest,css}"
  ],
  "swDest": "app/views/sw.js"
}

In package.json --> NPM scripts:
"build:sw": "workbox generateSW config/workbox-config.js",

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions