* feat(ui): add dynamic titles and sprite-based project/file icons * feat(files): add viewer syntax fallback and tab file icons * fix(files): restore file viewer highlighting and add diff file icons * feat(git): add file icons and async file-viewer syntax fallback * fix(files): force codemirror token colors in file viewer * feat(files): add shiki view mode for file viewer * fix(files): force codemirror parse after programmatic content updates * feat(files): support markdown frontmatter preview * feat(chat): use pierre diffs for tool previews * feat(chat): add configurable beautiful-mermaid rendering * feat(perf): virtualize chat rendering and add react-scan toggle * feat(build): enable React Compiler in Vite React apps * fix(chat): reduce rerenders from tooltips and streamed activity * fix(ui): make MessageList React Compiler safe * chore(ui): batch commit remaining pending ui updates * fix: polish chat and diff preview rendering - Keep Mermaid action buttons fixed while diagram content scrolls - Align Diff All Files headers and match Git-style path truncation - Default chat tool diffs to unified view with lightweight indicators disabled * fix: preserve file tree expansion and delay git action label collapse * fix: refine project icon controls in settings --------- Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
52 lines
1.6 KiB
TypeScript
52 lines
1.6 KiB
TypeScript
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import path from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
|
export default defineConfig({
|
|
root: path.resolve(__dirname, 'webview'),
|
|
base: './', // Use relative paths for VS Code webview
|
|
plugins: [
|
|
react({
|
|
babel: {
|
|
plugins: ['babel-plugin-react-compiler'],
|
|
},
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: [
|
|
{ find: '@opencode-ai/sdk/v2', replacement: path.resolve(__dirname, '../../node_modules/@opencode-ai/sdk/dist/v2/client.js') },
|
|
{ find: '@openchamber/ui', replacement: path.resolve(__dirname, '../ui/src') },
|
|
{ find: '@vscode', replacement: path.resolve(__dirname, './webview') },
|
|
{ find: '@', replacement: path.resolve(__dirname, '../ui/src') },
|
|
],
|
|
},
|
|
worker: {
|
|
format: 'es',
|
|
},
|
|
define: {
|
|
'process.env.NODE_ENV': JSON.stringify('production'),
|
|
'global': 'globalThis',
|
|
'__OPENCHAMBER_WEBVIEW_BUILD_TIME__': JSON.stringify(new Date().toISOString()),
|
|
},
|
|
envPrefix: ['VITE_'],
|
|
optimizeDeps: {
|
|
include: ['@opencode-ai/sdk/v2'],
|
|
},
|
|
build: {
|
|
outDir: path.resolve(__dirname, 'dist/webview'),
|
|
emptyOutDir: true,
|
|
rollupOptions: {
|
|
input: path.resolve(__dirname, 'webview/index.html'),
|
|
external: ['node:child_process', 'node:fs', 'node:path', 'node:url'],
|
|
output: {
|
|
entryFileNames: 'assets/[name].js',
|
|
chunkFileNames: 'assets/[name].js',
|
|
assetFileNames: 'assets/[name].[ext]',
|
|
},
|
|
},
|
|
},
|
|
});
|