LightRAG/lightrag_webui/src/main.tsx
yangdx 3f6423df33 Fix KaTeX extension loading by moving imports to app startup
• Move mhchem/copy-tex to main.tsx
• Add katex to Vite dedupe config
• Remove dynamic extension loading
• Ensure extensions available globally
• Fix chemistry formula rendering
2025-12-01 12:44:04 +08:00

17 lines
547 B
TypeScript

import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import './index.css'
import AppRouter from './AppRouter'
import './i18n.ts';
import 'katex/dist/katex.min.css';
// Import KaTeX extensions at app startup to ensure they are registered before any rendering
import 'katex/contrib/mhchem'; // Chemistry formulas: \ce{} and \pu{}
import 'katex/contrib/copy-tex'; // Allow copying rendered formulas as LaTeX source
createRoot(document.getElementById('root')!).render(
<StrictMode>
<AppRouter />
</StrictMode>
)