Skip to content

Commit dc6c227

Browse files
committed
format
1 parent 4a59191 commit dc6c227

File tree

11 files changed

+91
-88
lines changed

11 files changed

+91
-88
lines changed

website/docs/en/api/cli.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ $ rspack serve -c ./your.config.js
2828

2929
By default Rspack provides some common command line arguments, you can see all of them with --help.
3030

31-
| Flags | `|
31+
| Flags | ` |
3232
| ------------------------- | ------------------------------------------------------ |
3333
| -c, --config [value] | Specify the path to the configuration file |
3434
| --entry [value] | Specify the path to the entry file |

website/docs/en/config/module.mdx

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module.exports = {
5656
// Parser options for asset modules
5757
asset: {
5858
dataUrlCondition: {
59-
maxSize: 16192
59+
maxSize: 16192,
6060
},
6161
},
6262
// Parser options for javascript modules
@@ -71,11 +71,11 @@ module.exports = {
7171
namedExports: true,
7272
},
7373
// Parser options for css/auto modules
74-
"css/auto": {
74+
'css/auto': {
7575
namedExports: true,
7676
},
7777
// Parser options for css/module modules
78-
"css/module": {
78+
'css/module': {
7979
namedExports: true,
8080
},
8181
},
@@ -161,14 +161,14 @@ Use ES modules named export for css exports
161161
When using `namedExports: true`, you can use namespace or named import:
162162

163163
```js
164-
import * as classes from "./index.module.css"
165-
import { class1 } from "./index.module.css"
164+
import * as classes from './index.module.css';
165+
import { class1 } from './index.module.css';
166166
```
167167

168168
When using `namedExports: false`, you can use default import:
169169

170170
```js
171-
import classes from "./index.module.css"
171+
import classes from './index.module.css';
172172
```
173173

174174
### module.parser.css.namedExports
@@ -198,7 +198,7 @@ module.exports = {
198198
asset: {
199199
dataUrl: {
200200
encoding: false,
201-
mimetype: "base64",
201+
mimetype: 'base64',
202202
},
203203
filename: '[name]-[contenthash][ext]',
204204
publicPath: 'https://cdn.example.com/',
@@ -207,7 +207,7 @@ module.exports = {
207207
'asset/inline': {
208208
dataUrl: {
209209
encoding: false,
210-
mimetype: "base64",
210+
mimetype: 'base64',
211211
},
212212
},
213213
// Generator options for asset/resource modules
@@ -216,21 +216,21 @@ module.exports = {
216216
publicPath: 'https://cdn.example.com/',
217217
},
218218
// Generator options for css/auto modules
219-
"css/auto": {
220-
exportsConvention: "as-is",
219+
'css/auto': {
220+
exportsConvention: 'as-is',
221221
exportsOnly: false,
222-
localIdentName: "[uniqueName]-[id]-[local]",
222+
localIdentName: '[uniqueName]-[id]-[local]',
223223
},
224224
// Generator options for css modules
225225
css: {
226-
exportsConvention: "as-is",
226+
exportsConvention: 'as-is',
227227
exportsOnly: false,
228228
},
229229
// Generator options for css/module modules
230-
"css/module": {
231-
exportsConvention: "as-is",
230+
'css/module': {
231+
exportsConvention: 'as-is',
232232
exportsOnly: false,
233-
localIdentName: "[uniqueName]-[id]-[local]",
233+
localIdentName: '[uniqueName]-[id]-[local]',
234234
},
235235
},
236236
},
@@ -305,7 +305,7 @@ module.exports = {
305305
generator: {
306306
asset: {
307307
filename: 'static/[hash][ext]',
308-
}
308+
},
309309
},
310310
},
311311
};
@@ -324,7 +324,7 @@ module.exports = {
324324
generator: {
325325
asset: {
326326
publicPath: 'https://cdn.example.com/',
327-
}
327+
},
328328
},
329329
},
330330
};
@@ -586,11 +586,11 @@ module.exports = {
586586
parser: {
587587
namedExports: false,
588588
},
589-
type: "css/module",
590-
}
591-
]
592-
}
593-
}
589+
type: 'css/module',
590+
},
591+
],
592+
},
593+
};
594594
```
595595

596596
For specific parser options and the corresponding module type, you can refer to [`module.parser`](#moduleparser).
@@ -609,13 +609,13 @@ module.exports = {
609609
{
610610
test: /\.png/,
611611
generator: {
612-
filename: "[contenthash][ext]",
612+
filename: '[contenthash][ext]',
613613
},
614-
type: "asset",
615-
}
616-
]
617-
}
618-
}
614+
type: 'asset',
615+
},
616+
],
617+
},
618+
};
619619
```
620620

621621
For specific generator options and the corresponding module type, you can refer to [`module.generator`](#modulegenerator).

website/docs/en/config/other-options.mdx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ Tells Rspack to ignore specific warnings.
3232
```js title="rspack.config.js"
3333
module.exports = {
3434
//...
35-
ignoreWarnings: [
36-
/warning from compiler/,
37-
(warning) => true,
38-
],
35+
ignoreWarnings: [/warning from compiler/, (warning) => true],
3936
};
4037
```

website/docs/en/guide/asset-module.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ There are times when we want to optimize a specific image, for example by compre
106106
For example, optimizing all files ending in `.png` with [image-minimizer-webpack-plugin](https://github.com/webpack-contrib/image-minimizer-webpack-plugin):
107107

108108
```js title="rspack.config.js"
109-
const ImageMinimizerPlugin = require("image-minimizer-webpack-plugin");
109+
const ImageMinimizerPlugin = require('image-minimizer-webpack-plugin');
110110

111111
module.exports = {
112112
module: {

website/docs/en/guide/module-federation.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { ApiMeta, Stability } from '../../../components/ApiMeta';
66

77
Module Federation allows JavaScript applications to dynamically load code from other builds at runtime.
88
This feature has several use cases, including:
9+
910
- Independent applications (known as "microfrontends" in microfrontend architecture) to share modules without the need to recompile the entire application.
1011
- Distributed teams to work on different parts of the same application without the need to recompile the entire application.
1112
- Dynamic code loading and sharing between applications during runtime

website/docs/zh/api/cli.mdx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ $ rspack serve -c ./your.config.js
2828

2929
默认情况下 Rspack 提供了一些常用的命令行参数,你可以通过 --help 查看所有的命令行参数。
3030

31-
| 参数 | |
32-
| -------------------- | ------------------------ |
33-
| -c, --config [value] | 指定配置文件路径 |
34-
| --entry [value] | 指定入口文件路径 |
35-
| -m, --mode [value] | 指定构建模式 |
36-
| --devtool [value] | 控制是否生成 sourcemap |
37-
| --analyze | 是否开启构建分析 |
38-
| --json [value] | 输出打包信息为 JSON 文件 |
39-
| -w, --watch | 监听文件变化 |
40-
| -h, --help | 显示帮助信息 |
41-
| -v, --version | 显示版本号 |
42-
| --output-path [value]| 指定输出文件目录的绝对路径|
31+
| 参数 | |
32+
| --------------------- | -------------------------- |
33+
| -c, --config [value] | 指定配置文件路径 |
34+
| --entry [value] | 指定入口文件路径 |
35+
| -m, --mode [value] | 指定构建模式 |
36+
| --devtool [value] | 控制是否生成 sourcemap |
37+
| --analyze | 是否开启构建分析 |
38+
| --json [value] | 输出打包信息为 JSON 文件 |
39+
| -w, --watch | 监听文件变化 |
40+
| -h, --help | 显示帮助信息 |
41+
| -v, --version | 显示版本号 |
42+
| --output-path [value] | 指定输出文件目录的绝对路径 |

website/docs/zh/api/hmr.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -231,16 +231,16 @@ module.hot.status(); // 返回以下字符串之一...
231231
import.meta.webpackHot.status();
232232
```
233233

234-
| Status | Description |
235-
| ----------- | ------------------------------------------------------------------------- |
236-
| idle | 该进程正在等待调用 `check`(见下文) |
237-
| check | 该进程正在检查以更新 |
238-
| prepare     | 该进程正在准备更新(例如,下载已更新的模块) |
239-
| ready | 此更新已准备并可用 |
240-
| dispose | 该进程正在调用将被替换模块的 `dispose` 处理函数 |
234+
| Status | Description |
235+
| ----------- | --------------------------------------------------------------------------- |
236+
| idle | 该进程正在等待调用 `check`(见下文) |
237+
| check | 该进程正在检查以更新 |
238+
| prepare     | 该进程正在准备更新(例如,下载已更新的模块) |
239+
| ready | 此更新已准备并可用 |
240+
| dispose | 该进程正在调用将被替换模块的 `dispose` 处理函数 |
241241
| apply | 该进程正在调用 `accept` 处理函数,并重新执行自我接受(self-accepted)的模块 |
242-
| abort | 更新已中止,但系统仍处于之前的状态 |
243-
| fail | 更新已抛出异常,系统状态已被破坏 |
242+
| abort | 更新已中止,但系统仍处于之前的状态 |
243+
| fail | 更新已抛出异常,系统状态已被破坏 |
244244

245245
### check
246246

website/docs/zh/config/module.mdx

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module.exports = {
5656
// asset 模块的解析器选项
5757
asset: {
5858
dataUrlCondition: {
59-
maxSize: 16192
59+
maxSize: 16192,
6060
},
6161
},
6262
// javascript 模块的解析器选项
@@ -71,11 +71,11 @@ module.exports = {
7171
namedExports: true,
7272
},
7373
// css/auto 模块的解析器选项
74-
"css/auto": {
74+
'css/auto': {
7575
namedExports: true,
7676
},
7777
// css/module 模块的解析器选项
78-
"css/module": {
78+
'css/module': {
7979
namedExports: true,
8080
},
8181
},
@@ -161,13 +161,14 @@ module.exports = {
161161
当使用 `namedExports: true` 时,你可以使用命名空间或命名导入:
162162

163163
```js
164-
import * as classes from "./index.module.css"
165-
import { class1 } from "./index.module.css"
164+
import * as classes from './index.module.css';
165+
import { class1 } from './index.module.css';
166166
```
167+
167168
当使用 `namedExports: false` 时,你可以使用默认导入:
168169

169170
```js
170-
import classes from "./index.module.css"
171+
import classes from './index.module.css';
171172
```
172173

173174
### module.parser.css.namedExports
@@ -197,7 +198,7 @@ module.exports = {
197198
asset: {
198199
dataUrl: {
199200
encoding: false,
200-
mimetype: "base64",
201+
mimetype: 'base64',
201202
},
202203
filename: '[name]-[contenthash][ext]',
203204
publicPath: 'https://cdn.example.com/',
@@ -206,7 +207,7 @@ module.exports = {
206207
'asset/inline': {
207208
dataUrl: {
208209
encoding: false,
209-
mimetype: "base64",
210+
mimetype: 'base64',
210211
},
211212
},
212213
// asset/resource 模块的生成器选项
@@ -215,21 +216,21 @@ module.exports = {
215216
publicPath: 'https://cdn.example.com/',
216217
},
217218
// css/auto 模块的生成器选项
218-
"css/auto": {
219-
exportsConvention: "as-is",
219+
'css/auto': {
220+
exportsConvention: 'as-is',
220221
exportsOnly: false,
221-
localIdentName: "[uniqueName]-[id]-[local]",
222+
localIdentName: '[uniqueName]-[id]-[local]',
222223
},
223224
// css 模块的生成器选项
224225
css: {
225-
exportsConvention: "as-is",
226+
exportsConvention: 'as-is',
226227
exportsOnly: false,
227228
},
228229
// css/module 模块的生成器选项
229-
"css/module": {
230-
exportsConvention: "as-is",
230+
'css/module': {
231+
exportsConvention: 'as-is',
231232
exportsOnly: false,
232-
localIdentName: "[uniqueName]-[id]-[local]",
233+
localIdentName: '[uniqueName]-[id]-[local]',
233234
},
234235
},
235236
},
@@ -304,7 +305,7 @@ module.exports = {
304305
generator: {
305306
asset: {
306307
filename: 'static/[hash][ext]',
307-
}
308+
},
308309
},
309310
},
310311
};
@@ -323,7 +324,7 @@ module.exports = {
323324
generator: {
324325
asset: {
325326
publicPath: 'https://cdn.example.com/',
326-
}
327+
},
327328
},
328329
},
329330
};
@@ -585,11 +586,11 @@ module.exports = {
585586
parser: {
586587
namedExports: false,
587588
},
588-
type: "css/module",
589-
}
590-
]
591-
}
592-
}
589+
type: 'css/module',
590+
},
591+
],
592+
},
593+
};
593594
```
594595

595596
对于特定的解析器选项及其对应的模块类型,你可以参考 [`module.parser`](#moduleparser)
@@ -608,13 +609,13 @@ module.exports = {
608609
{
609610
test: /\.png/,
610611
generator: {
611-
filename: "[contenthash][ext]",
612+
filename: '[contenthash][ext]',
612613
},
613-
type: "asset",
614-
}
615-
]
616-
}
617-
}
614+
type: 'asset',
615+
},
616+
],
617+
},
618+
};
618619
```
619620

620621
对于特定的生成器选项及其对应的模块类型,你可以参考 [`module.generator`](#modulegenerator)

website/docs/zh/config/other-options.mdx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ module.exports = {
3131
```js title="rspack.config.js"
3232
module.exports = {
3333
//...
34-
ignoreWarnings: [
35-
/warning from compiler/,
36-
(warning) => true,
37-
],
34+
ignoreWarnings: [/warning from compiler/, (warning) => true],
3835
};
3936
```

website/docs/zh/guide/asset-module.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ module.exports = {
106106
例如对所有 `.png` 结尾的文件使用 [image-minimizer-webpack-plugin](https://github.com/webpack-contrib/image-minimizer-webpack-plugin) 进行优化:
107107

108108
```js title="rspack.config.js"
109-
const ImageMinimizerPlugin = require("image-minimizer-webpack-plugin");
109+
const ImageMinimizerPlugin = require('image-minimizer-webpack-plugin');
110110

111111
module.exports = {
112112
module: {

0 commit comments

Comments
 (0)