Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d5bd575

Browse filesBrowse files
docs(cn): 更新 externalsType 三个变量的翻译 (#1555)
* Update externals.mdx 更新externalsType的三个变量的翻译 * Update src/content/configuration/externals.mdx Co-authored-by: Jacob <jacob.lcs@qq.com> * Update src/content/configuration/externals.mdx Co-authored-by: Jacob <jacob.lcs@qq.com> * Update src/content/configuration/externals.mdx Co-authored-by: Jacob <jacob.lcs@qq.com> * Update src/content/configuration/externals.mdx Co-authored-by: Jacob <jacob.lcs@qq.com> * Update src/content/configuration/externals.mdx Co-authored-by: Jacob <jacob.lcs@qq.com> * Update src/content/configuration/externals.mdx Co-authored-by: Jacob <jacob.lcs@qq.com> Co-authored-by: Jacob <jacob.lcs@qq.com>
1 parent 48bea10 commit d5bd575
Copy full SHA for d5bd575

File tree

Expand file treeCollapse file tree

1 file changed

+6
-6
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-6
lines changed

‎src/content/configuration/externals.mdx

Copy file name to clipboardExpand all lines: src/content/configuration/externals.mdx
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,9 @@ module.exports = {
360360

361361
### externalsType.module $#externalstype-module$
362362

363-
Specify the default type of externals as `'module'`. Webpack will generate code like `import * as X from '...'` for externals used in a module.
363+
externals 类型设置为 `'module'`,webpack 将会在 module 中为外部引用生成形如 `import * as X from '...'` 的代码。
364364

365-
Make sure to enable [`experiments.outputModule`](/configuration/experiments/#experimentsoutputmodule) first, otherwise webpack will throw errors.
365+
确保首先把 [`experiments.outputModule`](/configuration/experiments/#experimentsoutputmodule) 设置为 `true`, 否则 webpack 将会报错。
366366

367367
**webpack.config.js**
368368

@@ -375,9 +375,9 @@ module.exports = {
375375
};
376376
```
377377

378-
### externalsType.node-commonjs
378+
### externalsType.node-commonjs $#externalstype-node-commonjs$
379379

380-
Specify the default type of externals as `'node-commonjs'`. Webpack will import [`createRequire`](https://nodejs.org/api/module.html#module_module_createrequire_filename) from `'module'` to construct a require function for loading externals used in a module.
380+
externals 类型设置为 `'node-commonjs'`,webpack 将从 `module` 中导入 `createRequire` 来构造一个 require 函数,用于加载模块中使用的外部对象。
381381

382382
```js
383383
module.export = {
@@ -388,9 +388,9 @@ module.export = {
388388
};
389389
```
390390

391-
### externalsType.script
391+
### externalsType.script $#externalstype-script$
392392

393-
Specify the default type of externals as `'script'`. Webpack will Load the external as a script exposing predefined global variables with HTML `<script>` element. The `<script>` tag would be removed after the script has been loaded.
393+
externals 类型设置为 `'script'`,webpack 将会通过 HTML 中的 `<script>` 标签加载一个脚本,以暴露预定义的全局变量。当脚本被加载完后 `<script>` 标签会被删除。
394394

395395
#### Syntax $#syntax$
396396

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.