goldhand / goldhand/sw-precache-webpack-plugin

Watching "static" HTML/PHP files with Webpack

Open
#150 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.4k
Forks
101
PR merge metrics
No merged PRs in 30d

Description

## **BEFORE YOU SUBMIT** please read the following:

* [ ] **I'm submitting a bug report**
* [ ] **I'm submitting a feature request**
* [x] **I'm submitting a support request**

**webpack version:**
3.11.0

**sw-precache-webpack-plugin version**:
0.11.5

**Please tell us about your environment:**
Linux - Ubuntu 16.04

**Browser:** [Phantom XX | Chrome XX | Firefox XX | IE XX | Safari XX | Other XX]

Chrome 65

**Current behavior:**

I am wondering how to properly deal with this. Currently I am caching some Laravel PHP files like so:

dynamicUrlToDependencies: {
'/': ['resources/views/home.blade.php']
}

This work but because the files are not part of the Webpack pipeline files like these are not being watched and a new `service-worker.js` file is never being generated once I edit files like `home.blade.php`.

It generates a hash without any problem but once I change this file I need to re-run my entire Webpack process to generate a new `service-worker.js` file which contains an updated hash.

I am not sure how a new `service-worker.js` file is currently being generated when Webpack notices a change in `css` or `js` file but the same would need to happen when `html` files like these have changed. Even if I could get Webpack to notice changes in these files I am unsure how to even call the plugin to re-generated the file.

Is there a good way to deal with this? Hopefully I have my question clear, otherwise ask me anything.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.