From 9fa716aea2ca74ca68434e1b7f48962d88c91033 Mon Sep 17 00:00:00 2001 From: Jisu-Woniu <31986081+Jisu-Woniu@users.noreply.github.com> Date: Fri, 24 Nov 2023 20:33:38 +0800 Subject: [PATCH] build: :wrench: Add build config for Vite. --- vite.config.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index 72f8bfa..0c74b51 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -23,11 +23,11 @@ export default defineConfig(async () => ({ // https://tauri.app/v1/api/config#buildconfig.beforedevcommand envPrefix: [ "VITE_", - "TAURI_PLATFORM", "TAURI_ARCH", "TAURI_FAMILY", - "TAURI_PLATFORM_VERSION", + "TAURI_PLATFORM", "TAURI_PLATFORM_TYPE", + "TAURI_PLATFORM_VERSION", "TAURI_DEBUG", ], css: { @@ -40,4 +40,10 @@ export default defineConfig(async () => ({ "@": fileURLToPath(new URL("./src", import.meta.url)), }, }, + build: { + // Tauri uses Chromium on Windows and WebKit on macOS and Linux + target: process.env.TAURI_PLATFORM == "windows" ? "chrome105" : "safari13", + // produce sourcemaps for debug builds + sourcemap: !!process.env.TAURI_DEBUG, + }, }));