You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/document/docs/en/guide/start/quick-start-shared.mdx
+64-13Lines changed: 64 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ module.exports = {
48
48
49
49
-**Options:** The plugin provides some configurations, please refer to [Options](../../config/options/options).
50
50
51
-
### Modern.js Framework
51
+
### Modern.js
52
52
53
53
Initialize the plugin in the [tools.rspack](https://modernjs.dev/configure/app/tools/rspack) of `modern.config.ts`:
54
54
@@ -78,9 +78,51 @@ export default {
78
78
For projects using Modern.js's webpack mode, please register the `RsdoctorWebpackPlugin` plugin through [tools.webpack](https://modernjs.dev/configure/app/tools/webpack).
79
79
:::
80
80
81
-
### Next.js Framework
81
+
### Next.js
82
82
83
-
Initialize the RsdoctorWebpackPlugin plugin in the [Webpack Config](https://nextjs.org/docs/app/api-reference/next-config-js/webpack) of `next.config.ts`.
83
+
#### Step 1: Register the Rsdoctor plugin
84
+
85
+
Initialize the [RsdoctorRspackPlugin](#rspack-projects)([RsdoctorWebpackPlugin](#webpack-projects)) plugin in the [Rspack Config](https://rspack.dev/guide/tech/next)([webpack config](https://nextjs.org/docs/pages/api-reference/config/next-config-js/webpack)) of `next.config.ts`.
-**Options:** The plugin provides some configuration options, please refer to [Options](../../config/options/options).
157
+
</Tab>
158
+
</Tabs>
116
159
117
-
#### 📢 Note for Next.js projects
160
+
-**Options:** The plugin provides some configuration options, please refer to [Options](../../config/options/options).
118
161
119
-
Since Next.js closes the terminal service after the `build` execution is completed, the report page server run by Rsdoctor during the build process will also be shut down. At this point, you can reopen the report page using [@rsdoctor/cli](/guide/start/cli) without having to execute the build operation again.
- Second, add the following scripts commands to **package.json**, executing **client:rsdoctor** or **server:rsdoctor** can open the report for the corresponding builder:
170
+
#### Step 3: Open the report
171
+
172
+
After installing [@rsdoctor/cli](/guide/start/cli), add the following scripts commands to **package.json**, executing **client:rsd** or **server:rsd** can open the report of the corresponding builder:
"server:rsd": "rsdoctor analyze --profile .next/server/.rsdoctor/manifest.json"// Rsdoctor's server report
133
180
}
134
181
```
135
182
136
-
For example, if Rsdoctor's build artifacts are located at the `.next/server/chunks/.rsdoctor/manifest.json` path, you can open the report page by executing the following command:
183
+
#### 📢 Note for Next.js
184
+
185
+
After Next.js finishes executing the `build` command, it will terminate the terminal service, causing the report page server run by Rsdoctor during the build process to close. To solve this problem, you can use [@rsdoctor/cli](/guide/start/cli) to reopen the report page without re-executing the build operation. The specific method is shown in the [third step](#step-3-open-the-report) or by locally executing the rsdoctor command:
186
+
187
+
For example, if Rsdoctor's build output is located at the path `.next/server/chunks/.rsdoctor/manifest.json`, you can open the report page by executing the following command:
0 commit comments