paimon-moe/vite.config.js
Made Baruna 593938c36d Migrate to SvelteKit
Close #158

commit b759884dce
Author: Made Baruna <made.setia@gmail.com>
Date:   Thu Jul 21 21:57:38 2022 +0700

    Add update popup

commit 00f8b192af
Author: Made Baruna <made.setia@gmail.com>
Date:   Thu Jul 21 20:09:18 2022 +0700

    Add service worker

commit 1cd1e40c77
Author: Made Baruna <made.setia@gmail.com>
Date:   Thu Jul 21 11:38:37 2022 +0700

    Update firebase config

commit edc036f62f
Author: Made Baruna <made.setia@gmail.com>
Date:   Wed Jul 20 23:33:38 2022 +0700

    Separate build getter

commit e780ab18bf
Author: Made Baruna <made.setia@gmail.com>
Date:   Wed Jul 20 22:16:28 2022 +0700

    Update readme

commit 7f0890acba
Author: Made Baruna <made.setia@gmail.com>
Date:   Wed Jul 20 22:07:25 2022 +0700

    Fix createEnv

commit 1df04e369f
Author: Made Baruna <made.setia@gmail.com>
Date:   Wed Jul 20 22:03:12 2022 +0700

    Migrate to svelte-kit
2022-07-21 22:24:14 +07:00

40 lines
878 B
JavaScript

import { resolve } from 'path';
import { sveltekit } from '@sveltejs/kit/vite';
import { build } from 'vite';
/** @type {import('vite').Plugin} */
const firebaseSwPlugin = {
name: 'firebaseplugin',
apply: 'build',
enforce: 'post',
buildEnd: async () => {
const conf = {
build: {
lib: {
entry: resolve(__dirname, 'src/firebase-messaging-sw.js'),
formats: ['es'],
},
rollupOptions: {
output: {
entryFileNames: 'firebase-messaging-sw.js',
},
},
outDir: resolve(__dirname, '.svelte-kit/output/client'),
emptyOutDir: false,
},
configFile: false,
};
await build(conf);
},
};
/** @type {import('vite').UserConfig} */
const config = {
build: {
sourcemap: true,
},
plugins: [sveltekit(), firebaseSwPlugin],
};
export default config;