Will
Will
```js apply(compiler) { const SingleEntryPlugin = require('webpack/lib/SingleEntryPlugin'); compiler.plugin("entry-option", (context, entry) => { compiler.apply(new SingleEntryPlugin('./', 'register-service-worker', 'register-service-worker')); }); } ```
Can you use an environment variable for the `.register(PATH)`? Btw, you need to specify `cache-control: no-cache` header on the service worker. Maybe neeed to draw more attention to that somewhere...
Just thinking on this, if one were to cache their main `index.html`, where the service worker, `service-worker.v1.js` is registered, then we try to deploy a new build, `service-worker.v2.js`, `index.html` still...
Ok! Want to work on a pr?
So index.html is not caching as you would like? Is it generated by webpack (using a loader like html-webpack-plugin)?
@darrylsepeda to clarify: Your index.html is hosted at the same url as your website **example.com/index.html** and your other assets and webpack.public_path are **cdn.com/assets/** Since **index.html** is at **example.com** (and not...
Seems like a legitimate feature request, will think about an api for this unless you have a suggestion @darrylsepeda
So what will that look like? ``` /** * API */ publicPathsMap: { [bundle: string]: [publicUrl: sring], } /** * Example */ import SWPrecacheWebpackPlugin from 'sw-precache-webpack-plugin'; const CDN_URL = 'https://cdn.com/';...
Is the only use for `index.html`? If that's the case, and it's certain, then we don't need to worry about much of an api. If there are other use cases,...
@hodor-cn, well done, that looks good to me! :smile: ``` mergeStaticsConfig:true, staticFileGlobs: ['dist/index.html'], stripPrefix: 'dist/' ``` Will add instructions to README and close this? Or is this still an issue?