How can I make manifest.webmanifest be different in production from staging #8463
-
My web app has a My app has two different deployment environment "staging" and "production" so I have a How can I make the staging and production environments point to different android apps in The first thing that comes to mind is dynamically emitting the manifest during the build process but it doesn't seam like SvelteKit has an easy way to do that. I considered writing a custom Vite plugin but thought I should ask here first. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Create a server route import type { RequestHandler } from './$types';
const manifest = /** generate web app manifest */
export const GET: RequestHandler = async () => {
return new Response(JSON.stringify(manifest), {
headers: {
'content-type': 'application/manifest+json',
},
});
};
export const prerender = true; // this line will generate a static manifest.webmanifest |
Beta Was this translation helpful? Give feedback.
Create a server route
./src/routes/manifest.webmanifest/+server.ts
, & prerender it.