goldhand / goldhand/sw-precache-webpack-plugin
wepback public path make index.html cache not working.
- Dominant language
- JavaScript
- Stars
- 1.4k
- Forks
- 101
- PR merge metrics
- No merged PRs in 30d
Description
* [x] **I'm submitting a bug report**
* [ ] **I'm submitting a feature request**
* [ ] **I'm submitting a support request**
**webpack version:**
2.2.1
**sw-precache-webpack-plugin version**:
0.9.2
**Please tell us about your environment:**
OSX 10.12.4
**Browser:** [Chrome 58.0.3029.110 (64-bit)]
**Current behavior:**
```
// webpack.config.js
...
output: {
publichPath: 'https://cdn.com/'
},
...
plugins: [
new SWPrecacheWebpackPlugin({
filename: 'sw.js',
staticFileGlobsIgnorePatterns: [/\.map$/]
})
]
```
```
//sw.js
...
var precacheConfig = [
['https://cdn.com/index.html', '1927d0eabd7c5d5d786731cf24b2675b']
...
```
That `https://cdn.com/index.html` make the `index.html` cache won't work. Cause the request url won't match.
**Expected/desired behavior:**
`index.html` can be cached properly.
*If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem along with your:*
* **Webpack configuration:**
```
// webpack.config.js
...
output: {
publichPath: 'https://cdn.com/'
},
...
plugins: [
new SWPrecacheWebpackPlugin({
filename: 'sw.js',
staticFileGlobsIgnorePatterns: [/\.map$/]
})
]
```
* **Generated service worker (not minified):**
```
//sw.js
...
var precacheConfig = [
['https://cdn.com/index.html', '1927d0eabd7c5d5d786731cf24b2675b']
...
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.