Following this thread I managed to set up service workers for my site. However, I’m running into a problem where my styles.css file fetch gives a 404 because the Hugo pipeline outputs styles.min.*.css where * is a random string.
Given that * is randomly generated during compile time, how would I specify the correct link in my sw.js file?
I’m not sure how it would work with my CSS file in /static. I’m used to placing it in /assets in my theme and using resources.Get from there. This is also where the * gets added. Apparently from fingerprinting. So I tested this out and I can get the service worker working without fingerprinting because then the file name remains a predictable styles.min.css which I can hard code into sw.js.
So I guess, given this progress, the question should simply be about how one can fingerprint and use service workers at the same time. I’ll give your harder approach a try now.