Skip to content

Inject Register script or inline has no effect on output HTML. #55

Description

@sksar

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",

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions