feat: Transform to Tauri desktop app
- Initialize Tauri v2 project with Rust backend - Restructure project: move source files to src/ directory - Add Tauri configuration for Windows, macOS, and Linux builds - Update Vite config for Tauri development workflow - Add file system and dialog permissions for native features - Update package.json with desktop build scripts - Update tsconfig.json paths for new src structure - Add Tauri and desktop badges to README - Document desktop build process and architecture
This commit is contained in:
@@ -1,20 +1,41 @@
|
||||
import path from 'path';
|
||||
import { defineConfig, loadEnv } from 'vite';
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, '.', '');
|
||||
return {
|
||||
server: {
|
||||
port: 3000,
|
||||
host: '0.0.0.0',
|
||||
},
|
||||
plugins: [react()],
|
||||
define: {},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, '.'),
|
||||
}
|
||||
}
|
||||
};
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
|
||||
// Vite options tailored for Tauri development
|
||||
clearScreen: false,
|
||||
|
||||
server: {
|
||||
port: 3000,
|
||||
strictPort: true,
|
||||
host: '0.0.0.0',
|
||||
// Tauri requires a consistent port for the dev server
|
||||
watch: {
|
||||
ignored: ['**/src-tauri/**'],
|
||||
},
|
||||
},
|
||||
|
||||
// to make use of `TAURI_DEBUG` and other env variables
|
||||
envPrefix: ['VITE_', 'TAURI_'],
|
||||
|
||||
build: {
|
||||
// Tauri supports es2021
|
||||
target: process.env.TAURI_PLATFORM == 'windows' ? 'chrome105' : 'safari13',
|
||||
// don't minify for debug builds
|
||||
minify: !process.env.TAURI_DEBUG ? 'esbuild' : false,
|
||||
// produce sourcemaps for debug builds
|
||||
sourcemap: !!process.env.TAURI_DEBUG,
|
||||
// Output to dist folder for Tauri
|
||||
outDir: 'dist',
|
||||
emptyOutDir: true,
|
||||
},
|
||||
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, './src'),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user