mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-01-31 00:35:19 +01:00
* Restructure the repository * lock file * fmt * fix bench * fix cli template test * remove accidental file * fix mv command * clippy * upgrade paths-filter github action * fix cli migration tests * lockfile * license headers * clippy * scope test-core to tauri crate * license header * correct --manifest-path usage * lockfile * fix tauri-driver on macOS [skip ci] * build target ios * try downgrade env_logger * downgrade 0.1.7 * try to fix bench * bench overflow * revert overflow fix, fix tauri_root_path * revert env_logger downgrade * fmt * raise msrv to 1.71 * fmt * delete .cargo/config.toml [skip ci] --------- Co-authored-by: Lucas Nogueira <lucas@tauri.app>
45 lines
1.1 KiB
JavaScript
45 lines
1.1 KiB
JavaScript
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
import { defineConfig } from 'vite'
|
|
import Unocss from 'unocss/vite'
|
|
import { svelte } from '@sveltejs/vite-plugin-svelte'
|
|
|
|
const host = process.env.TAURI_DEV_HOST
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [Unocss(), svelte()],
|
|
build: {
|
|
emptyOutDir: false,
|
|
rollupOptions: {
|
|
output: {
|
|
entryFileNames: `assets/[name].js`,
|
|
chunkFileNames: `assets/[name].js`,
|
|
assetFileNames: `assets/[name].[ext]`
|
|
}
|
|
}
|
|
},
|
|
|
|
// 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: host || false,
|
|
port: 1420,
|
|
strictPort: true,
|
|
hmr: host
|
|
? {
|
|
protocol: 'ws',
|
|
host: host,
|
|
port: 1430
|
|
}
|
|
: undefined,
|
|
fs: {
|
|
allow: ['.', '../../packages/api/dist']
|
|
}
|
|
}
|
|
})
|