J.A.R.V.I.S-rust/frontend/vite.config.ts

38 lines
929 B
TypeScript
Raw Normal View History

import { defineConfig } from "vite";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import sveltePreprocess from "svelte-preprocess";
import tsconfigPaths from 'vite-tsconfig-paths'
2026-01-04 09:00:51 +05:00
import routify from '@roxi/routify/vite-plugin'
2026-01-04 09:00:51 +05:00
export default defineConfig({
plugins: [
svelte({
preprocess: [
sveltePreprocess({
typescript: true,
}),
],
onwarn: (warning, handler) => {
const { code, frame } = warning;
if (code === "css-unused-selector")
return;
handler(warning);
},
}),
2026-01-04 09:00:51 +05:00
routify(),
tsconfigPaths()
],
clearScreen: false,
server: {
port: 1420,
strictPort: true,
},
envPrefix: ["VITE_", "TAURI_"],
build: {
target: process.env.TAURI_PLATFORM == "windows" ? "chrome105" : "safari13",
minify: !process.env.TAURI_DEBUG ? "esbuild" : false,
sourcemap: !!process.env.TAURI_DEBUG,
},
2026-01-04 09:00:51 +05:00
});