Add configurations for service worker
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
Alessio Davoli 2023-07-18 18:30:12 +02:00
parent e50ff329c3
commit 825a2e2f6a
2 changed files with 4 additions and 8 deletions

View file

@ -1,7 +1,7 @@
<script> <script>
import { pwaInfo } from 'virtual:pwa-info'; // import { pwaInfo } from 'virtual:pwa-info';
import BottomAppBar from '$lib/components/BottomAppBar.svelte'; import BottomAppBar from '$lib/components/BottomAppBar.svelte';
$: webManifestLink = pwaInfo ? pwaInfo.webManifest.linkTag : '' // $: webManifestLink = pwaInfo ? pwaInfo.webManifest.linkTag : ''
</script> </script>
<slot></slot> <slot></slot>
@ -9,9 +9,11 @@
<BottomAppBar /> <BottomAppBar />
</footer> </footer>
<!--
<svelte:head> <svelte:head>
{@html webManifestLink} {@html webManifestLink}
</svelte:head> </svelte:head>
-->
<style> <style>
footer { footer {

View file

@ -1,15 +1,9 @@
import { sveltekit } from "@sveltejs/kit/vite"; import { sveltekit } from "@sveltejs/kit/vite";
import adapter from "@sveltejs/adapter-node"; import adapter from "@sveltejs/adapter-node";
import { SvelteKitPWA } from '@vite-pwa/sveltekit'
const config = { const config = {
plugins: [ plugins: [
sveltekit(), sveltekit(),
SvelteKitPWA({
strategies: 'injectManifest',
srcDir: 'src',
filename: 'sw.ts',
})
], ],
test: { test: {
include: ["src/**/*.{test,spec}.{js,ts}"], include: ["src/**/*.{test,spec}.{js,ts}"],