mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-27 12:22:41 +00:00
feat: tauri serial polyfill
This commit is contained in:
@@ -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",
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
]
|
||||
: []),
|
||||
],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user