|
1 | | -import * as path from 'node:path'; |
2 | | -import { pluginCallstackTheme } from '@callstack/rspress-theme/plugin'; |
3 | | -import { pluginLlms } from '@rspress/plugin-llms'; |
4 | | -import { pluginOpenGraph } from 'rsbuild-plugin-open-graph'; |
5 | | -import { defineConfig } from 'rspress/config'; |
6 | | -import pluginSitemap from 'rspress-plugin-sitemap'; |
7 | | -import vercelPluginAnalytics from 'rspress-plugin-vercel-analytics'; |
| 1 | +import path from 'node:path'; |
| 2 | +import url from 'node:url'; |
| 3 | +import { withCallstackPreset } from '@callstack/rspress-preset'; |
| 4 | +import { defineConfig, type RspressPlugin } from '@rspress/core'; |
8 | 5 |
|
9 | | -export default defineConfig({ |
10 | | - root: path.join(__dirname, 'src'), |
11 | | - title: 'Rock', |
12 | | - icon: '/logo.svg', |
13 | | - outDir: 'build', |
14 | | - route: { |
15 | | - cleanUrls: true, |
16 | | - }, |
17 | | - logo: { |
18 | | - light: '/logo-light.svg', |
19 | | - dark: '/logo-dark.svg', |
20 | | - }, |
21 | | - builderConfig: { |
22 | | - plugins: [ |
23 | | - pluginOpenGraph({ |
24 | | - title: 'Rock', |
25 | | - type: 'website', |
26 | | - url: 'https://rockjs.dev', |
27 | | - image: 'https://rockjs.dev/og-image.jpg', |
28 | | - description: |
29 | | - 'Easy to adopt. Simple to scale. Built for flexibility from day one', |
30 | | - twitter: { |
31 | | - site: '@rockjs_dev', |
32 | | - card: 'summary_large_image', |
33 | | - }, |
34 | | - }), |
35 | | - ], |
36 | | - }, |
37 | | - themeConfig: { |
38 | | - socialLinks: [ |
39 | | - { |
40 | | - icon: 'github', |
41 | | - mode: 'link', |
42 | | - content: 'https://github.com/callstack/rock', |
| 6 | +const __filename = url.fileURLToPath(import.meta.url); |
| 7 | +const __dirname = path.dirname(__filename); |
| 8 | + |
| 9 | +export default withCallstackPreset( |
| 10 | + { |
| 11 | + context: __dirname, |
| 12 | + docs: { |
| 13 | + title: 'Rock', |
| 14 | + description: |
| 15 | + 'Easy to adopt. Simple to scale. Built for flexibility from day one', |
| 16 | + editUrl: 'https://github.com/callstack/rock/edit/main/website/src', |
| 17 | + icon: '/logo.svg', |
| 18 | + logoLight: '/logo-light.svg', |
| 19 | + logoDark: '/logo-dark.svg', |
| 20 | + ogImage: '/og-image.jpg', |
| 21 | + rootDir: 'src', |
| 22 | + rootUrl: 'https://rockjs.dev', |
| 23 | + socials: { |
| 24 | + github: 'https://github.com/callstack/rock', |
| 25 | + x: 'https://x.com/rockjs_dev', |
43 | 26 | }, |
44 | | - ], |
| 27 | + }, |
45 | 28 | }, |
46 | | - globalStyles: path.join(__dirname, 'theme/styles.css'), |
47 | | - plugins: [ |
48 | | - pluginCallstackTheme(), |
49 | | - // @ts-expect-error outdated @rspress/shared declared as dependency |
50 | | - vercelPluginAnalytics(), |
51 | | - pluginLlms({ |
52 | | - exclude: ({ page }) => page.routePath.includes('404'), |
53 | | - }), |
54 | | - // @ts-expect-error outdated @rspress/shared declared as dependency |
55 | | - pluginSitemap({ domain: 'https://rockjs.dev' }), |
56 | | - ], |
57 | | -}); |
| 29 | + defineConfig({ |
| 30 | + outDir: 'build', |
| 31 | + }), |
| 32 | +); |
0 commit comments