feat: tauri serial polyfill

This commit is contained in:
2023-08-03 00:27:03 +02:00
parent 5014e1e8e8
commit 9c1918e683
280 changed files with 262 additions and 3222564 deletions

View File

@@ -5,36 +5,43 @@ import {defineConfig} from "vite"
import {SvelteKitPWA} from "@vite-pwa/sveltekit"
import ViteYaml from "@modyfi/vite-plugin-yaml"
const isTauri = "TAURI_FAMILY" in process.env
export default defineConfig({
build: {
// we rely on the serial api, so just chrome is fine
target: ["chrome114"],
target: ["chrome114", "safari16"],
},
envPrefix: "TAURI_",
plugins: [
ViteYaml(),
sveltekit(),
SvelteKitPWA({
kit: {
trailingSlash: "always",
},
scope: "/",
base: "/",
includeAssets: ["favicon.png"],
workbox: {
globPatterns: ["**/*.{js,css,html,woff2,json,csv,png,svg}"],
},
manifest: {
name: "dot i/o",
id: "dot_io_v2",
theme_color: themeColor,
icons: [
{
src: "icon.svg",
sizes: "144x144",
type: "image/svg+xml",
},
],
},
}),
...(isTauri
? [
SvelteKitPWA({
kit: {
trailingSlash: "always",
},
scope: "/",
base: "/",
includeAssets: ["favicon.png"],
workbox: {
globPatterns: ["**/*.{js,css,html,woff2,json,csv,png,svg}"],
},
manifest: {
name: "dot i/o",
id: "dot_io_v2",
theme_color: themeColor,
icons: [
{
src: "icon.svg",
sizes: "144x144",
type: "image/svg+xml",
},
],
},
}),
]
: []),
],
})