mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-22 16:10:50 +00:00
Implements Google Drive sync operations (find, create, update, download, delete) via the Electron main process to work around CORS and COEP restrictions in the renderer. Updates the preload bridge and type definitions to expose new API methods, and adapts the sync logic to prefer main process proxies when available. Improves error handling and ensures prompt UI updates on disconnect. Enables more reliable Google Drive cloud sync across platforms.
41 lines
1.2 KiB
TypeScript
Executable File
41 lines
1.2 KiB
TypeScript
Executable File
import tailwindcss from '@tailwindcss/vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import path from 'path';
|
|
import { defineConfig } from 'vite';
|
|
|
|
export default defineConfig(() => {
|
|
return {
|
|
base: "./",
|
|
server: {
|
|
port: 5173,
|
|
host: 'localhost',
|
|
headers: {
|
|
// Required for SharedArrayBuffer and WASM in some browsers
|
|
'Cross-Origin-Opener-Policy': 'same-origin',
|
|
// Use credentialless to allow loading cross-origin images (e.g. Google avatars)
|
|
// while still enabling crossOriginIsolated.
|
|
'Cross-Origin-Embedder-Policy': 'credentialless',
|
|
},
|
|
},
|
|
build: {
|
|
chunkSizeWarningLimit: 3000,
|
|
target: 'esnext', // Required for top-level await in WASM modules
|
|
rollupOptions: {
|
|
output: {
|
|
// Disable code splitting for Electron compatibility with file:// protocol
|
|
manualChunks: undefined,
|
|
},
|
|
},
|
|
},
|
|
plugins: [tailwindcss(), react()],
|
|
optimizeDeps: {
|
|
exclude: ['ghostty-web'], // Don't pre-bundle ghostty-web to preserve WASM imports
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, '.'),
|
|
}
|
|
}
|
|
};
|
|
});
|