48 lines
1.1 KiB
TypeScript
48 lines
1.1 KiB
TypeScript
|
|
import { defineConfig } from 'vite'
|
||
|
|
import react from '@vitejs/plugin-react'
|
||
|
|
import UnoCSS from 'unocss/vite'
|
||
|
|
|
||
|
|
export default defineConfig(({ command }) => ({
|
||
|
|
plugins: [UnoCSS(), react()],
|
||
|
|
base: '/studio',
|
||
|
|
build: {
|
||
|
|
outDir: 'dist',
|
||
|
|
},
|
||
|
|
optimizeDeps: {
|
||
|
|
include: [
|
||
|
|
// Pre-bundle heavy Tiptap dependencies
|
||
|
|
'@tiptap/react',
|
||
|
|
'@tiptap/starter-kit',
|
||
|
|
'@tiptap/extension-link',
|
||
|
|
'@tiptap/extension-image',
|
||
|
|
'@tiptap/extension-placeholder',
|
||
|
|
'@tiptap/extension-table',
|
||
|
|
'@tiptap/extension-task-list',
|
||
|
|
'@tiptap/extension-task-item',
|
||
|
|
'@tiptap/extension-code-block-lowlight',
|
||
|
|
'@tiptap/markdown',
|
||
|
|
'lowlight',
|
||
|
|
// Monaco editor
|
||
|
|
'@monaco-editor/react',
|
||
|
|
],
|
||
|
|
},
|
||
|
|
...(command === 'serve' && {
|
||
|
|
server: {
|
||
|
|
host: true,
|
||
|
|
strictPort: true,
|
||
|
|
allowedHosts: true,
|
||
|
|
hmr: {
|
||
|
|
clientPort: 80,
|
||
|
|
path: '/studio',
|
||
|
|
},
|
||
|
|
warmup: {
|
||
|
|
clientFiles: [
|
||
|
|
'./src/components/editor/PostEditor.tsx',
|
||
|
|
'./src/components/editor/SourceEditor.tsx',
|
||
|
|
'./src/pages/PostEditorPage.tsx',
|
||
|
|
],
|
||
|
|
},
|
||
|
|
},
|
||
|
|
}),
|
||
|
|
}))
|