rspress.config.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. import * as path from 'node:path';
  2. import { defineConfig } from 'rspress/config';
  3. import { pluginPlayground } from '@rspress/plugin-playground';
  4. export default defineConfig({
  5. root: path.join(__dirname, 'src'),
  6. base: '/flowgram.ai/',
  7. title: 'FlowGram.AI',
  8. globalStyles: path.join(__dirname, './global.less'),
  9. builderConfig: {
  10. tools: {
  11. rspack: {
  12. // 禁用 ES 模块输出(启用 CommonJS)
  13. experiments: {
  14. outputModule: false,
  15. },
  16. // 允许省略文件扩展名
  17. resolve: {
  18. fullySpecified: false,
  19. },
  20. },
  21. },
  22. },
  23. ssg: false,
  24. // locales 为一个对象数组
  25. locales: [
  26. {
  27. lang: 'en',
  28. // 导航栏切换语言的标签
  29. label: 'English',
  30. title: 'Rspress',
  31. description: 'Static Site Generator',
  32. },
  33. {
  34. lang: 'zh',
  35. label: '简体中文',
  36. title: 'Rspress',
  37. description: '静态网站生成器',
  38. },
  39. ],
  40. icon: '/logo.png',
  41. logo: {
  42. light: '/logo.png',
  43. dark: '/logo.png',
  44. },
  45. lang: 'zh',
  46. logoText: 'FlowGram.AI',
  47. plugins: [
  48. pluginPlayground({
  49. defaultDirection: 'vertical',
  50. include: [],
  51. }),
  52. ],
  53. themeConfig: {
  54. footer: {
  55. message: '© 2025 Bytedance Inc. All Rights Reserved.',
  56. },
  57. lastUpdated: true,
  58. locales: [
  59. {
  60. lang: 'en',
  61. label: 'en',
  62. outlineTitle: 'ON THIS Page',
  63. },
  64. {
  65. lang: 'zh',
  66. label: 'zh',
  67. outlineTitle: '大纲',
  68. },
  69. ],
  70. socialLinks: [
  71. {
  72. icon: 'github',
  73. mode: 'link',
  74. content: 'https://github.com/coze-dev/flowgram.ai',
  75. },
  76. {
  77. icon: 'discord',
  78. mode: 'link',
  79. content: 'https://discord.gg/SwDWdrgA9f',
  80. },
  81. ],
  82. },
  83. });