Files
obelisk/app/electron.vite.config.ts
tommy0103andClaude Opus 5 c3751f0f6b feat(app): open local file references at the referenced line
Mark absolute Markdown links and inline-code relative paths as file
references, resolve them against the originating message cwd, and open
them in the configured editor. Local links no longer navigate the SPA
away from the running renderer.

The canonical transcript assembly projected messages down to seven
fields, so cwd and session_id never reached the renderer. Both are added
to SessionDetailMessage: cwd because the working directory can change
mid-session, session_id because it scopes which roots a reference may
resolve inside. The main process derives those roots from the database
rather than trusting anything the renderer sends.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 05:03:21 +08:00

40 lines
1.4 KiB
TypeScript

import { resolve } from 'node:path';
import { defineConfig, externalizeDepsPlugin } from 'electron-vite';
import vue from '@vitejs/plugin-vue';
// The app main/preload/renderer are TypeScript + ESM. Each main-process module
// is its own rollup input so it is emitted to out/main/<name>.js and the
// relative imports between them (and `new Worker(__dirname/indexer-worker.js)`)
// resolve to the built .js at runtime.
export default defineConfig({
main: {
plugins: [externalizeDepsPlugin()],
build: {
rollupOptions: {
input: {
index: resolve('src/main/index.ts'),
'file-reference': resolve('src/main/file-reference.ts'),
indexer: resolve('src/main/indexer.ts'),
'indexer-service': resolve('src/main/indexer-service.ts'),
'indexer-worker': resolve('src/main/indexer-worker.ts'),
'indexer-worker-client': resolve('src/main/indexer-worker-client.ts'),
'recap-capture-query': resolve('src/main/recap-capture-query.ts'),
},
},
},
},
preload: {
plugins: [externalizeDepsPlugin()],
build: {
rollupOptions: {
// Electron sandbox does not support ESM preload — emit CJS index.js
// (main loads ../preload/index.js) even though the project is ESM.
output: { format: 'cjs', entryFileNames: '[name].js' },
},
},
},
renderer: {
plugins: [vue()],
},
});