184 lines
6.2 KiB
TypeScript
184 lines
6.2 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: 'format-detection', content: 'telephone=no' },
|
|
{
|
|
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',
|
|
}
|
|
]
|
|
},
|
|
},
|
|
|
|
vue: {
|
|
config: {
|
|
performance: true,
|
|
}
|
|
},
|
|
|
|
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',
|
|
|
|
'comark',
|
|
'comark/plugins/breaks',
|
|
'comark/plugins/footnotes',
|
|
'comark/plugins/math',
|
|
'comlink',
|
|
'katex',
|
|
'shiki',
|
|
|
|
'@vue/devtools-core',
|
|
'@vue/devtools-kit',
|
|
'@sentry/nuxt',
|
|
'@floating-ui/vue',
|
|
'@nuxt/hints/runtime/hydration/component',
|
|
'@tanstack/vue-virtual',
|
|
'better-auth/vue',
|
|
'nanoid',
|
|
'drizzle-orm/pg-core'
|
|
],
|
|
},
|
|
build: {
|
|
commonjsOptions: {
|
|
transformMixedEsModules: 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,
|
|
// },
|
|
|
|
// nitro: {
|
|
// experimental: {
|
|
// wasm: true
|
|
// }
|
|
// },
|
|
|
|
modules: [
|
|
'@nuxt/hints',
|
|
'@unocss/nuxt',
|
|
// '@sentry/nuxt/module',
|
|
'@nuxt/fonts'
|
|
],
|
|
|
|
devtools: {
|
|
enabled: true,
|
|
|
|
timeline: {
|
|
enabled: true,
|
|
},
|
|
},
|
|
|
|
runtimeConfig: {
|
|
s3: {
|
|
accessKeyId: process.env.S3_ACCESS_KEY_ID!,
|
|
secret: process.env.S3_SECRET_ACCESS_KEY!,
|
|
bucket: process.env.S3_BUCKET_NAME!,
|
|
region: process.env.S3_REGION!,
|
|
endpoint: process.env.S3_ENDPOINT!,
|
|
},
|
|
|
|
public: {
|
|
disableSignup: process.env.DISABLE_SIGNUP === 'true' || process.env.DISABLE_SIGNUP === '1',
|
|
publicUrl: process.env.NUXT_PUBLIC_URL ?? 'http://localhost:3000',
|
|
}
|
|
},
|
|
|
|
compatibilityDate: '2025-07-15',
|
|
|
|
// sentry: {
|
|
// org: 'veridian-ol',
|
|
// project: 'javascript-nuxt',
|
|
// },
|
|
|
|
sourcemap: {
|
|
client: 'hidden',
|
|
},
|
|
}); |