Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use workbox precache manifest output #49

Closed
joaovieira opened this issue Aug 24, 2018 · 4 comments
Closed

Use workbox precache manifest output #49

joaovieira opened this issue Aug 24, 2018 · 4 comments

Comments

@joaovieira
Copy link
Contributor

joaovieira commented Aug 24, 2018

While digging in I found out that workbox-webpack-plugin limits all of the "transform" options to the globPattern files only. I.e. don't run modifyUrlPrefix on webpack-generated assets, for example. See whole explanation here.

I then found out this will be available in workbox-webpack-plugin v4: GoogleChrome/workbox#1591

We can still do all of that work manually:

  1. Read contents of precache-manifest.*.js
  2. Mimic modifyUrlPrefix according to the existing exportPathMap
  3. Remove revision from hashed files (maybe all)
  4. Ignore unserved files (e.g. build-manifest.json)

I'd be ok to wait for v4, given the current version is working fine. Reading from the generated precache manifest is just a more accurate process.

@hanford
Copy link
Owner

hanford commented Aug 24, 2018

Sounds good to me!

@joaovieira
Copy link
Contributor Author

Moreover, I'm wondering if we should really override the revision with Next's buildId. I believe the revision is the file's content hash. Thus, if the file didn't change between builds we shouldn't set another revision, as the file will already be cached.

@hanford
Copy link
Owner

hanford commented Aug 24, 2018

Good catch @joaovieira ! I can probably fix that today or this weekend unless you can beat me to it

@joaovieira
Copy link
Contributor Author

joaovieira commented Aug 24, 2018 via email

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

No branches or pull requests

2 participants