Skip to content
This repository has been archived by the owner on Apr 3, 2022. It is now read-only.

Workbox bundle assets #11

Open
michaeldanielbell opened this issue Sep 5, 2019 · 1 comment
Open

Workbox bundle assets #11

michaeldanielbell opened this issue Sep 5, 2019 · 1 comment

Comments

@michaeldanielbell
Copy link

michaeldanielbell commented Sep 5, 2019

Hi,

Is this plugin supposed to cache the built assets?

I had to add this to get it working

writeBundle(bundle) {
      options.importScripts = Object.keys(bundle);
      return build(options)
        .then(doRender)
        .catch(console.error);
    },

I'm using rollup 1.15.4

@Rainrider
Copy link
Owner

I don't think that using Object.keys(bundle) without further modification is the right general solution in this case. The file paths are relative to the rollup output dir and depend on the underlying OS, so they may break depending on where you generate the service worker.

Do you really intend importScripting the whole bundle though? If you are just looking to populate worbox' precache manifest, then using globDirectory may be a better way.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants