mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-06-06 13:53:54 +02:00
chore: update API example
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tauri-apps/cli": "2.0.0-rc.0",
|
||||
"internal-ip": "7.0.0",
|
||||
"typescript": "^5.2.2",
|
||||
"vite": "^5.0.13"
|
||||
}
|
||||
|
||||
@@ -3,25 +3,22 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import { defineConfig } from "vite";
|
||||
import { internalIpV4 } from "internal-ip";
|
||||
|
||||
const mobile =
|
||||
process.env.TAURI_PLATFORM === "android" ||
|
||||
process.env.TAURI_PLATFORM === "ios";
|
||||
const host = process.env.TAURI_DEV_HOST;
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig(async () => ({
|
||||
export default defineConfig({
|
||||
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
|
||||
// prevent vite from obscuring rust errors
|
||||
clearScreen: false,
|
||||
// tauri expects a fixed port, fail if that port is not available
|
||||
server: {
|
||||
host: mobile ? "0.0.0.0" : false,
|
||||
host: host || false,
|
||||
port: 1420,
|
||||
hmr: mobile
|
||||
hmr: host
|
||||
? {
|
||||
protocol: "ws",
|
||||
host: await internalIpV4(),
|
||||
host,
|
||||
port: 1421,
|
||||
}
|
||||
: undefined,
|
||||
@@ -38,4 +35,4 @@ export default defineConfig(async () => ({
|
||||
// produce sourcemaps for debug builds
|
||||
sourcemap: !!process.env.TAURI_DEBUG,
|
||||
},
|
||||
}));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user