Closed smatthews1999 closed 7 years ago
How are you running sw-precache
, i.e. what's your build process? Are you sure that you're generating your service worker after all the steps that bundle your JavaScript have completed?
Based on what you're seeing, it makes me think that the service worker generation is happening in parallel with your bundling, and that your vendor.[hash].bundle.js
isn't written to disk at the time that sw-precache
is doing its thing.
If you're using Webpack for bundling, I'd recommend using sw-precache-webpack-plugin
, which should know how to properly time itself so that it waits until your build is otherwise finished before it generates its service worker.
Thanks I found the problem. The compiled script is 2.11 mb and the max size is 2.1. Any way I can tweak that limit?
Yes, via https://github.com/GoogleChrome/sw-precache#maximumfilesizetocacheinbytes-number
(As a general best practice, shipping a that much JS code in a single bundle is probably going to lead to performance issues for your users.)
Hi guys. Kudos on a super tool. I am using this with much success but am having issues with a single script not being served by the service worker, even though it matches the wildcard in the config file.
The file in question is the file beginning with "vendor". config ...
I apologize if this is an error on my part. I did search for a while trying to find a solution.