nuxt-tiff-provider 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/module.d.mts +4 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +4 -2
- package/dist/runtime/register.client.js +2 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -32,6 +32,7 @@ export default defineNuxtConfig({
|
|
|
32
32
|
quality: 0.8, // default WebP quality 0..1
|
|
33
33
|
scope: '/', // Service Worker scope
|
|
34
34
|
autoRegister: true, // false → call registerTiffServiceWorker() yourself
|
|
35
|
+
retryRacedImages: true, // re-fetch images that raced the SW on first load
|
|
35
36
|
},
|
|
36
37
|
})
|
|
37
38
|
```
|
|
@@ -39,6 +40,8 @@ export default defineNuxtConfig({
|
|
|
39
40
|
## Notes
|
|
40
41
|
|
|
41
42
|
- Safari paints TIFF natively; the SW detects this and passes through.
|
|
43
|
+
- First cold visit: images requested before the SW took control are re-fetched
|
|
44
|
+
automatically once it does (disable with `retryRacedImages: false`).
|
|
42
45
|
- Already run your own Service Worker? Set `autoRegister: false` and
|
|
43
46
|
`importScripts('/tiff-sw.js')` inside it (see `@tiff-provider/core`).
|
|
44
47
|
- Sources must be same-origin or CORS-readable.
|
package/dist/module.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as nuxt_schema from 'nuxt/schema';
|
|
2
2
|
|
|
3
3
|
interface ModuleOptions {
|
|
4
4
|
/** Provider name used as <NuxtImg provider="..."> Default 'tiff'. */
|
|
@@ -11,8 +11,10 @@ interface ModuleOptions {
|
|
|
11
11
|
scope: string;
|
|
12
12
|
/** Auto-register the SW from a client plugin. Default true. */
|
|
13
13
|
autoRegister: boolean;
|
|
14
|
+
/** Re-request TIFF images that raced the SW on a cold load. Default true. */
|
|
15
|
+
retryRacedImages: boolean;
|
|
14
16
|
}
|
|
15
|
-
declare const module$1: NuxtModule<ModuleOptions>;
|
|
17
|
+
declare const module$1: nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
16
18
|
|
|
17
19
|
export { module$1 as default };
|
|
18
20
|
export type { ModuleOptions };
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -15,7 +15,8 @@ const module$1 = defineNuxtModule({
|
|
|
15
15
|
cacheName: "tiff-webp-v1",
|
|
16
16
|
quality: 0.8,
|
|
17
17
|
scope: "/",
|
|
18
|
-
autoRegister: true
|
|
18
|
+
autoRegister: true,
|
|
19
|
+
retryRacedImages: true
|
|
19
20
|
},
|
|
20
21
|
async setup(options, nuxt) {
|
|
21
22
|
const resolver = createResolver(import.meta.url);
|
|
@@ -58,7 +59,8 @@ const module$1 = defineNuxtModule({
|
|
|
58
59
|
{
|
|
59
60
|
cacheName: options.cacheName,
|
|
60
61
|
quality: options.quality,
|
|
61
|
-
scope: options.scope
|
|
62
|
+
scope: options.scope,
|
|
63
|
+
retryRacedImages: options.retryRacedImages
|
|
62
64
|
}
|
|
63
65
|
);
|
|
64
66
|
if (options.autoRegister) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-tiff-provider",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Nuxt module: render TIFFs via @nuxt/image off the main thread in a Service Worker.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nuxt",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@nuxt/image": "^1.11.0",
|
|
32
32
|
"@nuxt/kit": "^3.13.0",
|
|
33
33
|
"defu": "^6.1.0",
|
|
34
|
-
"@tiff-provider/core": "0.
|
|
34
|
+
"@tiff-provider/core": "0.2.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@nuxt/module-builder": "^1.0.0",
|