Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(api) fixed typo(#1726) #1727

Merged
merged 1 commit into from
Nov 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/content/api/module-methods.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ CommonJS 的目标是为浏览器之外的 JavaScript 指定一个生态系统
require(dependency: String);
```

已同步的方式检索其他模块的导出。编译器(compiler)会确保依赖项在输出 bundle 中可用。
以同步的方式检索其他模块的导出。编译器(compiler)会确保依赖项在输出 bundle 中可用。

```javascript
var $ = require('jquery');
Expand All @@ -194,7 +194,7 @@ W> 以异步的方式使用,可能不会达到预期效果。
require.resolve(dependency: String);
```

已同步的方式获取模块的 ID。编译器(compiler)会确保依赖项在最终输出 bundle 中可用。建议将其视为不透明值,只能与 `require.cache[id]` 或 `__webpack_require__(id)` 配合使用(最好避免这种用法)。
以同步的方式获取模块的 ID。编译器(compiler)会确保依赖项在最终输出 bundle 中可用。建议将其视为不透明值,只能与 `require.cache[id]` 或 `__webpack_require__(id)` 配合使用(最好避免这种用法)。

W> 模块 ID 的类型可以是 `number` 或 `string`,具体取决于 [`optimization.moduleIds`](/configuration/optimization/#optimizationmoduleids) 配置。

Expand Down