Why: The conversation and office fallbacks wrote marked output straight into the page, including converted docx HTML. Evidence: html-sinks ratchet forbids new innerHTML writes outside @ui safeHtml. Impact: Conversation keeps line-break rendering. Unsafe links are stripped after docx and pptx preview. dompurify is deduped with the UI package. Refs: feature/sillytavern-review Co-authored-by: Cursor <cursoragent@cursor.com>
23 lines
745 B
TypeScript
23 lines
745 B
TypeScript
import { fileURLToPath } from 'node:url'
|
||
import { defineConfig } from 'vite'
|
||
import react from '@vitejs/plugin-react'
|
||
|
||
// UI 组件库源码组合(modules/ui,源码级别名;见 Agent-System-Documents 提案 D29)。
|
||
const uiSrc = fileURLToPath(new URL('../ui/src', import.meta.url))
|
||
|
||
export default defineConfig({
|
||
plugins: [react()],
|
||
resolve: {
|
||
alias: [{ find: '@ui', replacement: uiSrc }],
|
||
// 源码组合下 ui 仓有自己的 node_modules;dedupe 强制最终 bundle 用 frontend 的单副本。
|
||
dedupe: ['react', 'react-dom', 'marked', 'dompurify'],
|
||
},
|
||
server: {
|
||
port: 5173,
|
||
proxy: {
|
||
'/api': { target: 'http://127.0.0.1:8787', changeOrigin: false },
|
||
},
|
||
},
|
||
test: { environment: 'node' },
|
||
})
|