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

Enable use of runtimeCaching in InjectManifest mode #1614

Closed
RehanSaeed opened this issue Aug 28, 2018 · 5 comments
Closed

Enable use of runtimeCaching in InjectManifest mode #1614

RehanSaeed opened this issue Aug 28, 2018 · 5 comments

Comments

@RehanSaeed
Copy link

Issue or Feature Request Description:

I only want InjectManifest to add a web push ability. It would be very useful if I could use the runtimeCaching option with InjectManifest. This would also make switching from GenerateSW mode to InjectManifest easier.

One workaround I can use is to enable GenerateSW with runtimeCaching once and then copy and paste the code into a service-worker.js file. However, now I have to maintain code when it could be generated for me.

@jeffposnick
Copy link
Contributor

Please see #708 (comment)

If you're not content with running GenerateSW once, you can just put your push handler code into a separate .js file and reference it in importScripts.

@SachsKaylee
Copy link

SachsKaylee commented Dec 10, 2018

Are there any plans in the future to support this?

I'm open to trying the importScripts method, but I'd like to save myself the effort of having to manually configure my transpiler for the service worker.

@jeffposnick
Copy link
Contributor

It's not on the roadmap. Better compilation/transpilation of the service worker when using webpack is on the radar, though: #1513

@YaoKaiLun
Copy link

Please see #708 (comment)

If you're not content with running GenerateSW once, you can just put your push handler code into a separate .js file and reference it in importScripts.

But the separate .js is hard to be managed by webpack especially when you want to hash its filename.

@cansin
Copy link

cansin commented May 3, 2020

I would like to re-raise this issue. Using a separate .js through importScripts requires additional build steps in order to import necessary code (If I am not missing sth). And trying to use the generated code by GenerateSW is not feasible given hashed filenames. (I am also having a problem with matchPrecache not able to match precached routes by GenerateSW on my separate importScripts'ed script, but that might be on my part.)

I am dumb nevermind. I think I don't need to worry about hashes on what I am trying to do.

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

5 participants