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

Using SW registration scope for default asset URLs #154

Open
1 of 3 tasks
roborourke opened this issue May 14, 2018 · 0 comments
Open
1 of 3 tasks

Using SW registration scope for default asset URLs #154

roborourke opened this issue May 14, 2018 · 0 comments

Comments

@roborourke
Copy link

  • I'm submitting a bug report
  • I'm submitting a feature request
  • I'm submitting a support request

webpack version:
4.x

sw-precache-webpack-plugin version:
0.11.4

Please tell us about your environment:
OSX 10.13.4

Browser:
Chrome 66

Current behavior:

In webpack 4, I can use an external global var to set the path for my app js and chunks by setting __webpack_public_path__.

SW Precache doesn't or can't use this as far as I can tell.

So I have a question - given that by default the service worker will be in the shared output directory, why not use the service worker registration scope to set the cached URLs? For example:

self.registration.scope + 'path/to/file.js'
  • Webpack configuration:

CRA default.

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

1 participant