Files
veridian/nuxt.config.ts
T
zoeissleeping 59bb7fbc12 Performance enhancements galore! New themining system
This is once again a huge commit, but its mostly performance
improvements along with some bug fixes and refactoring. It also includes
changes to the theming systems. I'm still not 100% happy with the
theming system, but its better than before.

Model fetching has been dramatically improved! Nearly all the important
computation and pre-processing has been moved to the server. This has
also somehow fixed the way model details are loaded, which was causing
many models to be missing their details despite models.dev having them.

The markdown renderer has once again been changed, but I'm mostly
certain that this is the last time major changes will be made to it. The
renderer is not spamming components, bloating memory usage, and its not
using a bug prone custom written chunking system.

There's also a lot more that I haven't mentioned and honestly forgot. I
need to get better commit hygiene tbh.
2026-02-20 00:20:50 -06:00

170 lines
6.0 KiB
TypeScript

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
ssr: true,
app: {
head: {
title: 'Veridian',
htmlAttrs: {
lang: 'en',
},
meta: [
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{
name: 'description',
content: 'A chat-based AI assistant for your LLMs.',
},
{
name: 'keywords',
content:
'LLM, AI, Chat, Assistant, Agent, LLMs, OpenAI, GPT, GPT-3, GPT-4, Claude, ChatGPT, Whisper, Bard, Bing, Anthropic, DeepAI, Dolly, StableLM, Vicuna, Llama, Alpaca, ChatGLM, MOSS, MPT, Codex, Codex2, Codex 3, Codex 4, Falcon, Flan-T5, T5, Llama2, LLaMA, LLaMA2, StableLM, OpenAssistant, OpenChat',
},
],
script: [
{
innerHTML: `
(function() {
try {
const cookies = document.cookie.split('; ');
const colorSchemeCookie = cookies.find(row => row.startsWith('colorScheme='));
const colorScheme = colorSchemeCookie ? decodeURIComponent(colorSchemeCookie.split('=')[1]) : 'system';
if (colorScheme === 'system') {
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
document.documentElement.classList.remove('light', 'dark');
document.documentElement.classList.add(prefersDark ? 'dark' : 'light');
} else {
document.documentElement.classList.remove('light', 'dark');
document.documentElement.classList.add(colorScheme);
}
} catch (e) {}
})();
`,
tagPosition: 'head',
type: 'text/javascript',
},
{
innerHTML: `
(function() {
const parent = document.createElement("div");
parent.setAttribute("style", "width:30px;height:30px;overflow:auto;position:absolute;top:-9999px;");
document.documentElement.appendChild(parent);
const child = document.createElement("div");
child.setAttribute("style", "width:100%;height:40px");
parent.appendChild(child);
const scrollbarWidth = parent.offsetWidth - child.offsetWidth;
if (scrollbarWidth > 0) {
document.documentElement.classList.add("has-obtrusive-scrollbars");
document.documentElement.style.setProperty('--scrollbar-width', scrollbarWidth + 'px');
parent.style.scrollbarWidth = 'thin';
const thinWidth = parent.offsetWidth - child.offsetWidth;
document.documentElement.style.setProperty('--thin-scrollbar-width', thinWidth + 'px');
}
document.documentElement.removeChild(parent);
})();
`,
tagPosition: 'bodyOpen',
type: 'text/javascript',
},
// {
// src: 'https://cdn.jsdelivr.net/npm/eruda',
// },
// {
// innerHTML: `
// eruda.init();
// `,
// }
]
},
},
vite: {
server: {
allowedHosts: true,
},
optimizeDeps: {
include: [
// shiki
'shiki/core',
'shiki/wasm',
'shiki/engine/javascript',
'shiki/engine/oniguruma',
'@shikijs/themes/vitesse-dark',
'@shikijs/themes/vitesse-light',
'@shikijs/langs/vue',
'@shikijs/langs/javascript',
'@shikijs/langs/typescript',
'@shikijs/langs/tsx',
'@shikijs/langs/python',
'@shikijs/langs/css',
'@shikijs/langs/html',
'@shikijs/langs/markdown',
'@shikijs/langs/json',
'@shikijs/langs/bash',
'@vue/devtools-core',
'@vue/devtools-kit',
'@sentry/nuxt',
'@nuxt/hints/runtime/hydration/component',
'vue-virtual-scroller',
'shiki',
'better-auth/vue',
'big.js',
'unified',
'remark-gfm',
'remark-parse',
'remark-rehype',
'remark-math',
'rehype-katex',
'unist-util-visit',
'@triplit/client',
'@triplit/db',
'comlink'
],
},
},
nitro: {
experimental: {
websocket: true,
}
},
// bizarely, when I enable this, it adds an 8 second or so lag when I navigate to a different page occasionally
// experimental: {
// viewTransition: true,
// },
modules: ['@vue-macros/nuxt', '@nuxt/hints', '@nuxt/icon', '@unocss/nuxt', 'triplit-nuxt', '@sentry/nuxt/module', '@nuxt/fonts'],
triplit: {
schema_path: './triplit/schema.ts',
serverUrl: process.env.NUXT_PUBLIC_TRIPLIT_URL,
token: process.env.NUXT_TRIPLIT_ANON_TOKEN,
storage: 'memory',
// we will connect automatically in the auth plugin when we call startSession
autoConnect: false,
},
devtools: {
enabled: true,
timeline: {
enabled: true,
},
},
compatibilityDate: '2025-07-15',
sentry: {
org: 'veridian-ol',
project: 'javascript-nuxt',
},
sourcemap: {
client: 'hidden',
},
});