Skip to content

Commit 6606235

Browse files
authored
fix: update rspress ssg example (#107)
* fix: update rspress ssg example * fix: bump version to 0.54
1 parent b88fd71 commit 6606235

File tree

7 files changed

+2600
-415
lines changed

7 files changed

+2600
-415
lines changed

examples/rspress-ssg/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ doc_build/
1111
# IDE
1212
.vscode/*
1313
!.vscode/extensions.json
14-
.idea
14+
.idea

examples/rspress-ssg/docs/_meta.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
},
77
{
88
"text": "Hello world",
9-
"link": "/hello/",
10-
"activeMatch": "/hello/"
9+
"link": "/hello",
10+
"activeMatch": "/hello"
1111
},
1212
{
1313
"text": "API",

examples/rspress-ssg/docs/guide/index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ title: Hello world
3434
```
3535

3636
> Note: By default, Rspress uses h1 headings as html headings.
37-
38-
You can also access properties defined in Front Matter in the body, for example:
37+
> You can also access properties defined in Front Matter in the body, for example:
3938
4039
```markdown
4140
---

examples/rspress-ssg/package.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,17 @@
88
"preview": "rspress preview"
99
},
1010
"dependencies": {
11-
"rspress": "^1.40.2",
12-
"zephyr-rspack-plugin": "catalog:zephyr"
11+
"@rsbuild/core": "^1.3.22",
12+
"@rsbuild/shared": "^0.7.10",
13+
"@rspack/core": "catalog:rspack",
14+
"@rspress/core": "1.43.12",
15+
"@rspress/shared": "^1.43.12",
16+
"globby": "^14.1.0",
17+
"rspress": "catalog:rspress",
18+
"webpack-sources": "^3.2.3",
19+
"zephyr-rspress-plugin": "catalog:zephyr"
1320
},
1421
"devDependencies": {
15-
"@types/node": "^18.11.17"
22+
"@types/node": "catalog:typescript"
1623
}
1724
}
Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,12 @@
1-
import * as path from "node:path";
2-
import { defineConfig } from "rspress/config";
3-
import { withZephyr } from "zephyr-rspack-plugin";
4-
5-
const zephyrRsbuildPlugin = () => ({
6-
name: "zephyr-rsbuild-plugin",
7-
setup(api: { modifyRspackConfig: (config: any) => Promise<void> }) {
8-
api.modifyRspackConfig(async (config: any) => {
9-
// this is important to avoid multiple zephyr build triggers
10-
config.name === "web" && (await withZephyr()(config));
11-
});
12-
},
13-
});
1+
// rspress.config.ts
2+
import path from 'node:path';
3+
import { defineConfig } from 'rspress/config';
4+
import { withZephyr } from 'zephyr-rspress-plugin';
145

156
export default defineConfig({
16-
root: path.join(__dirname, "docs"),
17-
title: "My Site",
18-
icon: "/rspress-icon.png",
19-
logo: {
20-
light: "/rspress-light-logo.png",
21-
dark: "/rspress-dark-logo.png",
22-
},
23-
themeConfig: {
24-
socialLinks: [
25-
{
26-
icon: "github",
27-
mode: "link",
28-
content: "https://github.com/web-infra-dev/rspress",
29-
},
30-
],
31-
},
7+
root: path.join(__dirname, 'docs'),
8+
outDir: './doc_build',
329
ssg: true,
33-
builderConfig: {
34-
plugins: [zephyrRsbuildPlugin()],
35-
},
10+
builderPlugins: [],
11+
plugins: [withZephyr()],
3612
});

pnpm-lock.yaml

Lines changed: 2567 additions & 368 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,14 @@ catalogs:
7676
"@typescript-eslint/parser": ^8.28.0
7777
"@typescript-eslint/utils": ^8.28.0
7878
zephyr:
79-
parcel-reporter-zephyr: ^0.0.53
80-
rollup-plugin-zephyr: ^0.0.53
81-
vite-plugin-zephyr: ^0.0.53
82-
zephyr-modernjs-plugin: ^0.0.53
83-
zephyr-rolldown-plugin: ^0.0.53
84-
zephyr-rspack-plugin: ^0.0.53
85-
zephyr-webpack-plugin: ^0.0.53
79+
parcel-reporter-zephyr: ^0.0.54
80+
rollup-plugin-zephyr: ^0.0.54
81+
vite-plugin-zephyr: ^0.0.54
82+
zephyr-modernjs-plugin: ^0.0.54
83+
zephyr-rolldown-plugin: ^0.0.54
84+
zephyr-rspack-plugin: ^0.0.54
85+
zephyr-webpack-plugin: ^0.0.54
86+
zephyr-rspress-plugin: ^0.0.54
8687
rollup:
8788
rollup: ^4.37.0
8889
rollup-plugin-postcss: ^4.0.2
@@ -115,6 +116,9 @@ catalogs:
115116
"@rspack/dev-server": ^1.1.0
116117
"@rspack/plugin-minify": ^0.7.5
117118
"@rspack/plugin-react-refresh": ^1.0.1
119+
rspress:
120+
"rspress": ^1.44.0
121+
"@rspress/shared": ^1.44.0
118122
vite5:
119123
vite: ^5.4.15
120124
vite-plugin-inspect: ^0.8.7

0 commit comments

Comments
 (0)