Skip to content

Option for dev=false to still load additional SW's from importScripts() #277

@lupas

Description

@lupas

What problem does this feature solve?

When dev === false, not only the workbox module, but also other additional service-workers loaded via importScripts are not loaded.

In my case I am fine with disabling workbox in development, but I would still want all (or some of) my other service workers to be loaded in development mode.

What does the proposed changes look like?

Something like this in nuxt.config.js:

// OLD
importScripts: [
  '/my-other-sw.js',
],

// PROPOSED
importScripts: [
  {
    src: '/my-other-sw.js',
    force: true // also load in dev when dev=false
  }
],

If that makes sense I'm happy to do a PR for it.

This feature request is available on Nuxt community (#c206)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions