flotilla/vite.config.ts

63 lines
1.6 KiB
TypeScript
Raw Normal View History

2024-12-02 17:51:50 +00:00
import {config} from "dotenv"
2024-10-22 23:23:54 +00:00
import {defineConfig} from "vite"
2024-10-23 16:45:06 +00:00
import {SvelteKitPWA} from "@vite-pwa/sveltekit"
2024-08-05 22:28:46 +00:00
import {sveltekit} from "@sveltejs/kit/vite"
import svg from "@poppanator/sveltekit-svg"
2024-08-01 23:49:32 +00:00
2024-12-02 17:51:50 +00:00
config({path: ".env.local"})
config({path: ".env.template"})
2024-10-22 23:23:54 +00:00
2024-10-22 23:53:39 +00:00
export default defineConfig({
server: {
port: 1847,
},
build: {
sourcemap: true,
},
plugins: [
sveltekit(),
SvelteKitPWA({
registerType: "autoUpdate",
injectRegister: "auto",
workbox: {
maximumFileSizeToCacheInBytes: 5 * 1024 ** 2, // 5 MB or set to something else
},
2024-10-22 23:53:39 +00:00
manifest: {
2024-10-23 15:55:40 +00:00
name: process.env.VITE_PLATFORM_NAME,
short_name: process.env.VITE_PLATFORM_NAME,
theme_color: process.env.VITE_PLATFORM_ACCENT,
description: process.env.VITE_PLATFORM_DESCRIPTION,
2024-10-23 16:45:06 +00:00
// @ts-ignore
2024-10-22 23:53:39 +00:00
permissions: ["clipboardRead", "clipboardWrite", "unlimitedStorage"],
icons: [
{src: "pwa-64x64.png", sizes: "64x64", type: "image/png"},
{src: "pwa-192x192.png", sizes: "192x192", type: "image/png"},
{src: "pwa-512x512.png", sizes: "512x512", type: "image/png", purpose: "any"},
2024-10-22 23:23:54 +00:00
{
2024-10-22 23:53:39 +00:00
src: "maskable-icon-512x512.png",
sizes: "512x512",
2024-10-22 23:23:54 +00:00
type: "image/png",
2024-10-22 23:53:39 +00:00
purpose: "maskable",
2024-10-22 23:23:54 +00:00
},
2024-10-22 23:53:39 +00:00
],
},
}),
svg({
svgoOptions: {
multipass: true,
plugins: [
2024-10-22 23:23:54 +00:00
{
2024-10-22 23:53:39 +00:00
name: "preset-default",
params: {
overrides: {
removeViewBox: false,
},
},
2024-10-22 23:23:54 +00:00
},
2024-10-22 23:53:39 +00:00
"removeDimensions",
2024-08-05 21:45:16 +00:00
],
2024-10-22 23:53:39 +00:00
},
}),
],
2024-08-05 22:28:46 +00:00
})