Files
afilmory/apps/docs/vite.config.ts
Innei d5a2ea4db2 feat: enhance documentation and add new features for Afilmory
- Introduced a comprehensive `DEVELOPMENT.md` guide for contributors and self-hosters, detailing workspace layout and common commands.
- Updated `README.md` to include links to the new development guide and improved deployment instructions.
- Added new documentation files covering architecture, builder pipeline, configuration, and deployment strategies.
- Implemented new storage provider documentation for Backblaze B2, Eagle, GitHub, and local storage options.
- Enhanced the UI components with new features, including a navigation context and improved theme handling.
- Removed outdated GitHub Action deployment documentation.

Signed-off-by: Innei <tukon479@gmail.com>
2025-11-23 19:40:51 +08:00

76 lines
1.9 KiB
TypeScript

import path from 'node:path'
import mdx from '@mdx-js/rollup'
import shikiRehype from '@shikijs/rehype'
import tailwindcss from '@tailwindcss/vite'
import react from '@vitejs/plugin-react'
import { codeInspectorPlugin } from 'code-inspector-plugin'
import remarkFrontmatter from 'remark-frontmatter'
import remarkGfm from 'remark-gfm'
import { defineConfig } from 'vite'
import { astPlugin } from '../../plugins/vite/ast'
import remarkHeading from './plugins/remark-heading'
import { routeGenerator } from './plugins/route-generater'
import { tocExtractor } from './plugins/toc-extractor'
// https://vite.dev/config/
export default defineConfig({
plugins: [
tocExtractor({
contentsDir: 'contents',
outputDir: 'src',
outputFile: 'toc-data.ts',
}),
routeGenerator({
contentsDir: 'contents',
outputDir: 'src',
outputFile: 'routes.ts',
indexFile: 'index',
}),
astPlugin,
tailwindcss(),
{
enforce: 'pre',
...mdx({
// files inside contents will be processed as MDX
include: ['contents/**/*.{md,mdx}'],
providerImportSource: '@mdx-js/react',
remarkPlugins: [[remarkHeading, { prefix: 'heading-' }], remarkFrontmatter, remarkGfm],
rehypePlugins: [
[
shikiRehype,
{
themes: { light: 'github-light', dark: 'github-dark' },
inline: 'tailing-curly-colon',
langs: [
'javascript',
'typescript',
'jsx',
'tsx',
'mdx',
'json',
'shell',
'bash',
'yaml',
'dockerfile',
'css',
],
},
],
],
}),
},
codeInspectorPlugin({
bundler: 'vite',
hotKeys: ['altKey'],
}),
react(),
],
resolve: {
alias: {
'@': path.resolve(__dirname, '.'),
},
},
})