Skip to content

Commit

Permalink
docs: update optimization.moduleIds
Browse files Browse the repository at this point in the history
  • Loading branch information
colinaaa committed May 31, 2024
1 parent 87d0b60 commit 164178b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion website/docs/en/config/optimization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ Rspack will select appropriate optimization configuration based on the [`mode`](

## optimization.moduleIds

<PropertyType type="'named' | 'deterministic'" />
<PropertyType type="'natural' | 'named' | 'deterministic'" />

| option | description |
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `natural` | Use numeric ids in order of usage. This option is enabled by default when mode is `'none'`. |
| `named` | Use meaningful, easy-to-debug content as id. This option is enabled by default in development mode. |
| `deterministic` | Use the hashed module identifier as the id to benefit from long-term caching. This option is enabled by default in production mode. |

Expand Down
3 changes: 2 additions & 1 deletion website/docs/zh/config/optimization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ import WebpackLicense from '@components/webpack-license';

## optimization.moduleIds

<PropertyType.CN type="'named' | 'deterministic'" />
<PropertyType.CN type="'natural' | 'named' | 'deterministic'" />

| 选项 | 描述 |
| --------------- | --------------------------------------------------------------------------------------- |
| `natural` | 根据模块加载的顺序使用自增数字作为模块 id。此选项会在 `mode``none` 时默认开启。 |
| `named` | 使用有意义、方便调试的内容当作模块 id。此选项会在开发环境下默认开启。 |
| `deterministic` | 使用对模块标识符哈希后的数字当作模块 id,有益于长期缓存。此选项会在生产环境下默认开启。 |

Expand Down

0 comments on commit 164178b

Please sign in to comment.