[Init] Initial commit - NetMesh terminal manager
Some checks failed
build-packages / resolve bundled mosh-client (push) Has been cancelled
build-packages / resolve bundled et-client (push) Has been cancelled
build-packages / build-macos (push) Has been cancelled
build-packages / build-windows (push) Has been cancelled
build-packages / build-linux-x64 (push) Has been cancelled
build-packages / build-linux-arm64 (push) Has been cancelled
build-packages / release (push) Has been cancelled
build-packages / update Nix release metadata (push) Has been cancelled
build-packages / bump homebrew tap (push) Has been cancelled
test / lint-and-test (push) Has been cancelled
AI automation / Route event (push) Has been cancelled
AI automation / Hand reopened issue to maintainers (push) Has been cancelled
AI automation / Clean source issue state (push) Has been cancelled
AI automation / Reconcile handoffs (push) Has been cancelled
AI automation / Classify issue (push) Has been cancelled
AI automation / Claude Code smoke (push) Has been cancelled
AI automation / Review issue follow-up (push) Has been cancelled
AI automation / Publish issue follow-up (push) Has been cancelled
AI automation / Implement with Claude Code (push) Has been cancelled
AI automation / Publish implement PR (push) Has been cancelled
AI automation / Continue queued issue comments (push) Has been cancelled
AI automation / Codex review loop (push) Has been cancelled
AI automation / Publish Codex fix (push) Has been cancelled
AI automation / Clear Codex dispatch marker (push) Has been cancelled
AI automation / Own PR re-request Codex (push) Has been cancelled
AI automation / External PR re-request Codex (push) Has been cancelled
AI automation / Poll Codex reaction / retry (push) Has been cancelled
build-et-binaries / build-linux-x64 (push) Has been cancelled
build-et-binaries / build-linux-arm64 (push) Has been cancelled
build-et-binaries / build-macos-universal (push) Has been cancelled
build-et-binaries / build-windows-x64 (push) Has been cancelled
build-et-binaries / release (push) Has been cancelled
Some checks failed
build-packages / resolve bundled mosh-client (push) Has been cancelled
build-packages / resolve bundled et-client (push) Has been cancelled
build-packages / build-macos (push) Has been cancelled
build-packages / build-windows (push) Has been cancelled
build-packages / build-linux-x64 (push) Has been cancelled
build-packages / build-linux-arm64 (push) Has been cancelled
build-packages / release (push) Has been cancelled
build-packages / update Nix release metadata (push) Has been cancelled
build-packages / bump homebrew tap (push) Has been cancelled
test / lint-and-test (push) Has been cancelled
AI automation / Route event (push) Has been cancelled
AI automation / Hand reopened issue to maintainers (push) Has been cancelled
AI automation / Clean source issue state (push) Has been cancelled
AI automation / Reconcile handoffs (push) Has been cancelled
AI automation / Classify issue (push) Has been cancelled
AI automation / Claude Code smoke (push) Has been cancelled
AI automation / Review issue follow-up (push) Has been cancelled
AI automation / Publish issue follow-up (push) Has been cancelled
AI automation / Implement with Claude Code (push) Has been cancelled
AI automation / Publish implement PR (push) Has been cancelled
AI automation / Continue queued issue comments (push) Has been cancelled
AI automation / Codex review loop (push) Has been cancelled
AI automation / Publish Codex fix (push) Has been cancelled
AI automation / Clear Codex dispatch marker (push) Has been cancelled
AI automation / Own PR re-request Codex (push) Has been cancelled
AI automation / External PR re-request Codex (push) Has been cancelled
AI automation / Poll Codex reaction / retry (push) Has been cancelled
build-et-binaries / build-linux-x64 (push) Has been cancelled
build-et-binaries / build-linux-arm64 (push) Has been cancelled
build-et-binaries / build-macos-universal (push) Has been cancelled
build-et-binaries / build-windows-x64 (push) Has been cancelled
build-et-binaries / release (push) Has been cancelled
This commit is contained in:
142
vite.config.ts
Normal file
142
vite.config.ts
Normal file
@@ -0,0 +1,142 @@
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import path from 'path';
|
||||
import { defineConfig, type Plugin } from 'vite';
|
||||
|
||||
// Custom plugin to suppress monaco-editor source map warnings
|
||||
const suppressMonacoSourcemapWarning = () => ({
|
||||
name: 'suppress-monaco-sourcemap-warning',
|
||||
apply: 'serve' as const,
|
||||
configResolved(config: { logger: { warn: (msg: string, options?: { timestamp?: boolean }) => void } }) {
|
||||
const originalWarn = config.logger.warn;
|
||||
config.logger.warn = (msg: string, options?: { timestamp?: boolean }) => {
|
||||
// Suppress monaco-editor source map warnings
|
||||
if (msg.includes('monaco-editor') && msg.includes('source map')) return;
|
||||
if (msg.includes('loader.js.map')) return;
|
||||
originalWarn(msg, options);
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
const devContentSecurityPolicy = [
|
||||
"default-src 'self'",
|
||||
"script-src 'self' 'unsafe-inline' 'unsafe-eval' 'wasm-unsafe-eval'",
|
||||
"worker-src 'self' blob:",
|
||||
"style-src 'self' 'unsafe-inline'",
|
||||
"font-src 'self' data:",
|
||||
"connect-src 'self' data: blob: ws: wss: https: http://localhost:5173",
|
||||
"img-src 'self' data: https:",
|
||||
].join("; ");
|
||||
|
||||
const devContentSecurityPolicyPlugin = () => ({
|
||||
name: 'dev-content-security-policy',
|
||||
apply: 'serve' as const,
|
||||
transformIndexHtml(html: string) {
|
||||
return html.replace(
|
||||
/content="default-src 'self'; script-src 'self' 'unsafe-inline' 'wasm-unsafe-eval'; worker-src 'self' blob:; style-src 'self' 'unsafe-inline'; font-src 'self' data:; connect-src 'self' data: blob: ws: wss: https:; img-src 'self' data: https:;"/,
|
||||
`content="${devContentSecurityPolicy}"`,
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* Stale pre-bundles return 504 after git pull / npm install. Vite retries the
|
||||
* module once optimize finishes — do not full-reload the Electron window.
|
||||
* Opening the lazy AI panel pulls `ai` / streamdown; a 504 there used to flash
|
||||
* the boot splash and wipe renderer state.
|
||||
*/
|
||||
const warnOnOutdatedOptimizeDep = (): Plugin => ({
|
||||
name: 'warn-on-outdated-optimize-dep',
|
||||
apply: 'serve',
|
||||
configureServer(server) {
|
||||
server.middlewares.use((req, res, next) => {
|
||||
res.on('finish', () => {
|
||||
if (
|
||||
res.statusCode === 504
|
||||
&& req.url?.includes('/node_modules/.vite/deps/')
|
||||
) {
|
||||
server.config.logger.warn(
|
||||
`[vite] stale optimize dep 504 for ${req.url} (not reloading the app)`,
|
||||
);
|
||||
}
|
||||
});
|
||||
next();
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
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',
|
||||
},
|
||||
hmr: {
|
||||
overlay: true,
|
||||
},
|
||||
},
|
||||
build: {
|
||||
chunkSizeWarningLimit: 3000,
|
||||
target: 'esnext', // Required for top-level await in WASM modules
|
||||
sourcemap: false, // Disable source maps to avoid missing map file warnings
|
||||
// Optimize chunk splitting for faster initial load
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks: {
|
||||
// Vendor chunks - rarely change, can be cached aggressively
|
||||
'vendor-radix': [
|
||||
'@radix-ui/react-collapsible',
|
||||
'@radix-ui/react-context-menu',
|
||||
'@radix-ui/react-dialog',
|
||||
'@radix-ui/react-popover',
|
||||
'@radix-ui/react-scroll-area',
|
||||
'@radix-ui/react-select',
|
||||
'@radix-ui/react-tabs',
|
||||
],
|
||||
'vendor-xterm': [
|
||||
'@xterm/xterm',
|
||||
'@xterm/addon-fit',
|
||||
'@xterm/addon-image',
|
||||
'@xterm/addon-search',
|
||||
'@xterm/addon-serialize',
|
||||
'@xterm/addon-web-links',
|
||||
'@xterm/addon-webgl',
|
||||
],
|
||||
'vendor-ai': [
|
||||
'ai',
|
||||
'@ai-sdk/openai',
|
||||
'@ai-sdk/anthropic',
|
||||
'@ai-sdk/google',
|
||||
'zod',
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [suppressMonacoSourcemapWarning(), devContentSecurityPolicyPlugin(), warnOnOutdatedOptimizeDep(), tailwindcss(), react()],
|
||||
optimizeDeps: {
|
||||
include: [
|
||||
'ai',
|
||||
'@ai-sdk/openai',
|
||||
'@ai-sdk/anthropic',
|
||||
'@ai-sdk/google',
|
||||
'streamdown',
|
||||
'@streamdown/cjk',
|
||||
'@streamdown/code',
|
||||
'zod',
|
||||
],
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, '.'),
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user