Skip to content

Commit 39cab6d

Browse files
Copilotchenjiahan
andauthored
docs: fix various documentation errors including grammar, terminology and typos (#11445)
* Initial plan * docs: fix various documentation errors including grammar, terminology and typos Co-authored-by: chenjiahan <[email protected]> * Update compiler.mdx * Update compiler.mdx --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: chenjiahan <[email protected]> Co-authored-by: neverland <[email protected]>
1 parent 9c09fcd commit 39cab6d

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

website/docs/en/api/javascript-api/compilation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class ExamplePlugin {
5252

5353
### emitAsset
5454

55-
Emit a new asset, throw an error if the asset has already exists.
55+
Emit a new asset, throw an error if the asset already exists.
5656

5757
```ts
5858
emitAsset(

website/docs/en/api/javascript-api/compiler.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ It provides methods like [run](#run) and [watch](#watch) to start builds, while
2020

2121
### run
2222

23-
Start a compilation, and callbacked when the compilation is completed or aborted due to an error.
23+
Start a compilation, and calls back when the compilation is completed or aborted due to an error.
2424

2525
```ts
2626
function run(
@@ -47,9 +47,9 @@ If you need to call the `run` method of the same `compiler` object multiple time
4747
```js
4848
compiler.run((err, stats) => {
4949
// Deal with the compiler errors
50-
handlerCompilerError(err);
50+
handleCompilerError(err);
5151
// Deal with the compilation errors
52-
handlerModuleErrors(stats.toJson().errors);
52+
handleModuleErrors(stats.toJson().errors);
5353
// Deal with the result
5454
handleBuildResult(stats);
5555
// End this compilation
@@ -68,7 +68,7 @@ compiler.run((err, stats) => {
6868

6969
### watch
7070

71-
Watching files and directories, start a compilation process after they change, and callbacked every time the compilation is completed or aborted due to an error.
71+
Watching files and directories, start a compilation process after they change, and calls back every time the compilation is completed or aborted due to an error.
7272

7373
```ts
7474
function watch(

website/docs/en/api/javascript-api/stats-json.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ type StatsChunk = {
141141
// Sibling chunk IDs
142142
siblings?: Array<string>;
143143

144-
// Chunk create reason when splitting hunks (need to enable `optimization.splitChunks`).
144+
// Chunk create reason when splitting chunks (need to enable `optimization.splitChunks`).
145145
reason?: string;
146146
// List of idHints of the cache groups hit when splitting chunks (need to enable `optimization.splitChunks`).
147147
idHints: Array<string>;
@@ -258,7 +258,7 @@ type StatsModule = {
258258

259259
## Entry/ChunkGroup Object
260260

261-
Each entrypoint or chunk group object represents an group of chunks and assets, and its structure is as follows:
261+
Each entrypoint or chunk group object represents a group of chunks and assets, and its structure is as follows:
262262

263263
```ts
264264
type StatsEntrypoints = Record<string, StatsChunkGroup>;
@@ -309,7 +309,7 @@ type StatsChunkGroup = {
309309

310310
## Error/Warning Object
311311

312-
Each error or warning object represents an error/warning threw during the build process, and its structure is as follows:
312+
Each error or warning object represents an error/warning thrown during the build process, and its structure is as follows:
313313

314314
```ts
315315
type StatsError = {

website/docs/en/guide/migration/webpack.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ To ensure the correctness of the build output, Rspack enables strict validation
5656
However, Rspack also provides a loose mode for easy progressive migration. You can enable it by setting the `RSPACK_CONFIG_VALIDATE` environment variable:
5757

5858
```bash
59-
# Enable loose validation mode will print out erroneous configurations but will not throw error.
59+
# Enabling loose validation mode will print out erroneous configurations but will not throw an error.
6060
RSPACK_CONFIG_VALIDATE=loose rspack build
61-
# Enable loose validation mode, without printing errors or throwing error.
61+
# Enable loose validation mode, without printing errors or throwing an error.
6262
RSPACK_CONFIG_VALIDATE=loose-silent rspack build
6363
```
6464

website/docs/zh/api/javascript-api/compiler.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ function run(
4747
```js
4848
compiler.run((err, stats) => {
4949
// 处理构建器错误
50-
handlerCompilerError(err);
50+
handleCompilerError(err);
5151
// 处理编译错误
52-
handlerModuleErrors(stats.toJson().errors);
52+
handleModuleErrors(stats.toJson().errors);
5353
// 处理构建结果
5454
handleBuildResult(stats);
5555
// 结束本次编译

0 commit comments

Comments
 (0)