mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2025-12-12 22:06:18 +00:00
refactor: use standard prettier formatting
This commit is contained in:
@@ -1,23 +1,26 @@
|
||||
// noinspection ES6PreferShortImport
|
||||
import {themeColor} from "./src/lib/style/theme.server"
|
||||
import {sveltekit} from "@sveltejs/kit/vite"
|
||||
import {defineConfig} from "vite"
|
||||
import {SvelteKitPWA} from "@vite-pwa/sveltekit"
|
||||
import ViteYaml from "@modyfi/vite-plugin-yaml"
|
||||
import {readFile} from "fs/promises"
|
||||
import {fileURLToPath} from "url"
|
||||
import { themeColor } from "./src/lib/style/theme.server";
|
||||
import { sveltekit } from "@sveltejs/kit/vite";
|
||||
import { defineConfig } from "vite";
|
||||
import { SvelteKitPWA } from "@vite-pwa/sveltekit";
|
||||
import ViteYaml from "@modyfi/vite-plugin-yaml";
|
||||
import { readFile } from "fs/promises";
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
const isTauri = "TAURI_FAMILY" in process.env
|
||||
console.info(isTauri ? "Building for Tauri" : "Building for PWA")
|
||||
const {homepage, bugs, repository} = JSON.parse(
|
||||
await readFile(fileURLToPath(new URL("package.json", import.meta.url)), "utf8"),
|
||||
)
|
||||
const isTauri = "TAURI_FAMILY" in process.env;
|
||||
console.info(isTauri ? "Building for Tauri" : "Building for PWA");
|
||||
const { homepage, bugs, repository } = JSON.parse(
|
||||
await readFile(
|
||||
fileURLToPath(new URL("package.json", import.meta.url)),
|
||||
"utf8",
|
||||
),
|
||||
);
|
||||
|
||||
process.env.VITE_HOMEPAGE_URL = repository.url.replace(/\.git$/, "")
|
||||
process.env.VITE_DOCS_URL = homepage
|
||||
process.env.VITE_BUGS_URL = bugs.url
|
||||
process.env.VITE_LEARN_URL = "https://www.iq-eq.io/"
|
||||
process.env.VITE_LATEST_FIRMWARE = "1.1.3"
|
||||
process.env.VITE_HOMEPAGE_URL = repository.url.replace(/\.git$/, "");
|
||||
process.env.VITE_DOCS_URL = homepage;
|
||||
process.env.VITE_BUGS_URL = bugs.url;
|
||||
process.env.VITE_LEARN_URL = "https://www.iq-eq.io/";
|
||||
process.env.VITE_LATEST_FIRMWARE = "1.1.3";
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
@@ -44,7 +47,10 @@ export default defineConfig({
|
||||
includeAssets: ["favicon.png"],
|
||||
workbox: {
|
||||
// https://vite-pwa-org.netlify.app/frameworks/sveltekit.html#globpatterns
|
||||
globPatterns: ["client/**/*.{js,map,css,woff2,csv,png,svg}", "prerendered/**/*.html"],
|
||||
globPatterns: [
|
||||
"client/**/*.{js,map,css,woff2,csv,png,svg}",
|
||||
"prerendered/**/*.html",
|
||||
],
|
||||
},
|
||||
manifest: {
|
||||
name: "CharaChorder Device Manager",
|
||||
@@ -61,4 +67,4 @@ export default defineConfig({
|
||||
}),
|
||||
]),
|
||||
],
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user