goldhand / goldhand/sw-precache-webpack-plugin

Looking for Feature Like importScripts but For Static Results Outside of Webpack

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

Description

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

**webpack version:**
4.5.0

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

**Please tell us about your environment:**
OSX 10.x

**Browser:** Chrome 66

**Current behavior:**

There is no way (that I know of) to do something like `importScripts` but for static HTML pages that _are not_ a part of the Webpack build.

**Expected/desired behavior:**

Some sort of option for `importScripts` but it's just `importStatic` or similar so that the service worker will cache static pages of HTML.

Example:

```Javascript
const swGenerator = new SWPrecacheWebpackPlugin({
/* ... */
importStatic: ["/", "/foo", "/bar"]
});
```

☝🏻That would cause the service worker to cache the HTML present in the result of those URLs.

**Additional context:**

I'm using Laravel + Vue.js, so the Laravel bits are responsible for certain URLs returning certain HTML, so webpack doesn't know about any of the files being outputted because it's dynamically generated and served by Laravel. Maybe I'm just holding it wrong for this plugin, but I can't find a way to get it to generate a service worker file that includes certain, arbitrary URLs to be precached as well.

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.