Skip to content

Commit

Permalink
build: 🔧 Add build config for Vite.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jisu-Woniu committed Nov 24, 2023
1 parent 6bf1a49 commit 9fa716a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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,
},
}));

0 comments on commit 9fa716a

Please sign in to comment.