I am using this for a SvelteKit app in SPA mode.
These are the configs:
vite.config.js
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
import { SvelteKitPWA } from '@vite-pwa/sveltekit';
export default defineConfig({
plugins: [
sveltekit(),
SvelteKitPWA({
injectRegister: 'inline',
})
]
});
svelte.config.js
import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/kit/vite';
/** @type {import('@sveltejs/kit').Config} */
export default {
kit: {
adapter: adapter({
fallback: 'index.html',
precompress: !!process.env.CF_PAGES,
})
},
preprocess: vitePreprocess()
};
+layout.js
export const ssr = false;
export const prerender = false; // SPA mode
However, despite all attempts for a full day, the output index.html has no meta tags linking to the manifest and has no script tag or even inline script to do the register / inject. Both inline mode or script doesn't work. Both of them are behaving like null.
Dependencies:
"@sveltejs/kit": "^1.5.0",
"@vite-pwa/sveltekit": "^0.2.2",
"@sveltejs/adapter-static": "^2.0.2",
"vite": "^4.3.0"
"svelte": "^3.54.0",
I am using this for a SvelteKit app in SPA mode.
These are the configs:
vite.config.js
svelte.config.js
+layout.js
However, despite all attempts for a full day, the output index.html has no meta tags linking to the manifest and has no script tag or even inline script to do the register / inject. Both inline mode or script doesn't work. Both of them are behaving like null.
Dependencies: