This commit is contained in:
David Reed 2022-10-01 18:26:29 -04:00
parent da3743f3cf
commit 2da39c96f1
3 changed files with 12 additions and 10 deletions

View file

@ -1,21 +1,23 @@
# v1.0.2
This package now targets CommonJS.
# v1.0.1
In your `sw.js` script, you MUST import `uv.bundle.js` then `uv.config.js` in order. This is because we can no longer hard-code the paths. Ideally, we would import `uv.config.js` then use the config.bundle path in the serviceworker, however the config is dependant on `uv.bundle.js`, which we don't know the location to.
Old:
```js
importScripts('./uv/uv.sw.js');
const sw = new UVServiceWorker();
self.addEventListener('fetch', event =>
event.respondWith(
sw.fetch(event)
)
);
self.addEventListener('fetch', (event) => event.respondWith(sw.fetch(event)));
```
New:
```diff
+ importScripts('./uv/uv.bundle.js');
+ importScripts('./uv/uv.config.js');
@ -30,4 +32,4 @@ self.addEventListener('fetch', event =>
);
```
You are still required to specify all paths in `uv.config.js`.
You are still required to specify all paths in `uv.config.js`.

6
package-lock.json generated
View file

@ -1,13 +1,13 @@
{
"name": "ultraviolet",
"version": "1.0.1",
"version": "1.0.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "ultraviolet",
"version": "1.0.1",
"license": "ISC",
"version": "1.0.2",
"license": "MIT",
"dependencies": {
"bowser": "^2.11.0",
"css-tree": "^2.0.4",

View file

@ -1,6 +1,6 @@
{
"name": "ultraviolet",
"version": "1.0.1",
"version": "1.0.2",
"description": "Proxy",
"main": "lib/index.js",
"scripts": {