Skip to content

Commit 492261d

Browse files
committed
fix: load sw from absolute path
1 parent 3e1b4d3 commit 492261d

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ const customOptions = {
7474
versionPath: "/api/v2/",
7575
cache: true,
7676
timeout: 5 * 1000, // 5s
77-
cacheImages: true
77+
cacheImages: true,
78+
swLocation: '/'
7879
}
7980
const pokedex = await Pokedex.init(customOptions);
8081
```

test/cdn.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// var PJSW_DEBUG=1
77
</script>
88
<script type="module">
9-
//import {Pokedex} from "https://cdn.jsdelivr.net/gh/pokeapi/pokeapi-js-wrapper@beta/src/index.js"
9+
//import {Pokedex} from "https://cdn.jsdelivr.net/gh/pokeapi/pokeapi-js-wrapper/src/index.js"
1010
import {Pokedex} from "../src/index.js"
1111
const pokedex = await Pokedex.init();
1212
const version = await pokedex.getVersionByName(1)

test/example-sw.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<title>SW test</title>
55
<script type="module">
66
import {Pokedex} from '../src/index.js'
7-
const P = await Pokedex.init({ cacheImages: true });
7+
const P = await Pokedex.init({ cacheImages: true, swLocation: '/pokeapi-js-wrapper/test/' });
88
</script>
99
</head>
1010

0 commit comments

Comments
 (0)