nousresearch--hermes-agent
b4fbd6fe9f
Deploy Site / deploy-vercel (push) Has been skipped
Deploy Site / deploy-docs (push) Has been skipped
Build Skills Index / build-index (push) Has been skipped
CI / Deny unrelated histories (push) Has been skipped
CI / Detect affected areas (push) Successful in 27m35s
CI / OSV scan (push) Failing after 4s
CI / Build&Test Docker image (push) Successful in 9s
CI / Supply-chain scan (push) Has been skipped
CI / Lint Docker scripts (push) Failing after 5m13s
CI / Check contributors (push) Failing after 12m8s
CI / Docs Site (push) Failing after 12m8s
CI / TypeScript (push) Failing after 12m8s
CI / Python lints (push) Failing after 12m9s
CI / Python tests (push) Failing after 12m9s
CI / Check uv.lock (push) Failing after 23m22s
CI / CI timing report (push) Has been cancelled
Build Skills Index / trigger-deploy (push) Has been cancelled
CI / All required checks pass (push) Has been cancelled
82 行
2.8 KiB
TypeScript
82 行
2.8 KiB
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import path from 'path'
|
|
import fs from 'fs'
|
|
|
|
// `hgui` symlinks a worktree's node_modules to the main checkout. Vite realpaths
|
|
// those before enforcing server.fs.allow, so codicon/font assets resolve outside
|
|
// the worktree root and 404. Whitelist the real node_modules locations.
|
|
const real = (p: string): string | null => {
|
|
try {
|
|
return fs.realpathSync(p)
|
|
} catch {
|
|
return null
|
|
}
|
|
}
|
|
|
|
const fsAllow = [
|
|
...new Set(
|
|
[
|
|
path.resolve(__dirname, '../..'),
|
|
real(path.resolve(__dirname, 'node_modules')),
|
|
real(path.resolve(__dirname, '../../node_modules'))
|
|
].filter((p): p is string => p !== null)
|
|
)
|
|
]
|
|
|
|
export default defineConfig({
|
|
base: './',
|
|
plugins: [react(), tailwindcss()],
|
|
css: {
|
|
// Pin an explicit (empty) PostCSS config. Tailwind is handled entirely by
|
|
// `@tailwindcss/vite`, so the renderer needs no PostCSS plugins — and
|
|
// without this, Vite's `postcss-load-config` walks UP the filesystem
|
|
// looking for a stray `postcss.config.*` / `tailwind.config.*`. The desktop
|
|
// build runs from inside the user's home tree (e.g.
|
|
// `C:\Users\<name>\AppData\Local\hermes\hermes-agent\apps\desktop`), so an
|
|
// unrelated Tailwind v3 config higher up the tree gets picked up and
|
|
// reprocesses our v4 stylesheet, failing the build with
|
|
// "`@layer base` is used but no matching `@tailwind base` directive is
|
|
// present." Pinning the config makes the build hermetic.
|
|
postcss: { plugins: [] }
|
|
},
|
|
build: {
|
|
// Keep desktop packaging stable: Shiki ships many dynamic chunks by
|
|
// default, and electron-builder can OOM scanning thousands of files.
|
|
// Collapsing to a single chunk is intentional, so the renderer bundle is
|
|
// large by design (~22 MB). Raise the warning ceiling above that so the
|
|
// cosmetic "chunk larger than 500 kB" nag stays quiet, while still acting
|
|
// as a regression alarm if the bundle balloons well past today's size.
|
|
chunkSizeWarningLimit: 25000,
|
|
rolldownOptions: {
|
|
output: {
|
|
codeSplitting: false
|
|
}
|
|
}
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
'@hermes/shared': path.resolve(__dirname, '../shared/src'),
|
|
react: path.resolve(__dirname, '../../node_modules/react'),
|
|
'react-dom': path.resolve(__dirname, '../../node_modules/react-dom'),
|
|
'react/jsx-dev-runtime': path.resolve(__dirname, '../../node_modules/react/jsx-dev-runtime.js'),
|
|
'react/jsx-runtime': path.resolve(__dirname, '../../node_modules/react/jsx-runtime.js')
|
|
},
|
|
dedupe: ['react', 'react-dom']
|
|
},
|
|
server: {
|
|
host: '127.0.0.1',
|
|
port: 5174,
|
|
strictPort: true,
|
|
fs: {
|
|
allow: fsAllow
|
|
}
|
|
},
|
|
preview: {
|
|
host: '127.0.0.1',
|
|
port: 4174
|
|
}
|
|
})
|