Skip to content

docs(cn): translate src/content/migrate/4.md #772

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

Merged
merged 3 commits into from
Jun 22, 2020

Conversation

Catherine001li
Copy link

翻译完成src\content\migrate\4.md文件

url: https://gist.github.com/sokra/1522d586b8e5c0f5072d7565c2bee693
- title: 'webpack 4: migration guide for plugins/loaders'
url: https://medium.com/webpack/webpack-4-migration-guide-for-plugins-loaders-20a79b927202
相关信息:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不需要翻译

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请参考其他 pr

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改,请审阅

title: To v4 from v3
sort: 2
contributors:
标题: 从V3到V4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你改动了文档格式...

@netlify
Copy link

netlify bot commented Jun 20, 2020

Deploy preview for cn-webpack ready!

Built with commit 1b1891c

https://deploy-preview-772--cn-webpack.netlify.app

@QC-L QC-L changed the title docs(cn): translate src\content\migrate\4.md docs(cn): translate src/content/migrate/4.md Jun 21, 2020
@@ -14,30 +14,30 @@ related:
url: https://medium.com/webpack/webpack-4-migration-guide-for-plugins-loaders-20a79b927202
---

This guide only shows major changes that affect end users. For more details please see [the changelog](https://github.com/webpack/webpack/releases).
这篇指南仅仅展示了影响用户使用的主要改变。更多细节查看 [更新日志(the changelog)](ttps://github.com/webpack/webpack/releases)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
这篇指南仅仅展示了影响用户使用的主要改变。更多细节查看 [更新日志(the changelog)](ttps://github.com/webpack/webpack/releases)
这篇指南仅仅展示了影响用户使用的主要改变。更多细节查看 [更新日志(the changelog)](https://github.com/webpack/webpack/releases)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修改


The CLI has moved to a separate package: webpack-cli. You need to install it before using webpack, see [basic setup](/guides/getting-started/#basic-setup).
脚手架 (CLI) 已经放至一个单独的 webpack-cli 中。在你使用 webpack之前需要安装它,参见 [基础步骤](/guides/getting-started/#basic-setup).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
脚手架 (CLI) 已经放至一个单独的 webpack-cli 中。在你使用 webpack之前需要安装它,参见 [基础步骤](/guides/getting-started/#basic-setup).
脚手架 (CLI) 已经放至一个单独的 webpack-cli 中。在你使用 webpack 之前需要安装它,参见[基础步骤](/guides/getting-started/#basic-setup).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修改


The installation guide can be found [here](/guides/installation).
安装指南见 [这里](/guides/installation)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
安装指南见 [这里](/guides/installation)
安装指南见[这里](/guides/installation)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修改



## mode
## 模式 (mode
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## 模式 (mode)
## 模式(mode)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修改


Add the new [`mode`](/configuration/mode/) option to your configuration. Set it to `'production'`, `'development'` or `'none'` depending on your configuration type.
在你的配置中添加新的 [`模式 (mode)`](/configuration/mode/) 选项。设置它为 `'生产 (production)'`, `'开发 (development)'` or `'无 (none)'`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
在你的配置中添加新的 [`模式 (mode)`](/configuration/mode/) 选项。设置它为 `'生产 (production)'`, `'开发 (development)'` or `'无 (none)'`
在你的配置中添加新的 [`模式mode`](/configuration/mode/) 选项。设置它为 `'production'``'development'` 或者 `'none'`

@@ -49,11 +49,11 @@ module.exports = {
}
```

T> The purpose of `'development'` mode and `'production'` mode is different. You can use `webpack-merge` as shown in [production guide](/guides/production/#setup) to optimize configurations.
注:`'开发 (development)'` 模式和 `'生产 (production)'` 模式的用途是不同的。你可以使用 [操作指南](/guides/production/#setup) 中的 `webpack-merge` 来优化配置。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
注:`'开发 (development)'` 模式和 `'生产 (production)'` 模式的用途是不同的。你可以使用 [操作指南](/guides/production/#setup) 中的 `webpack-merge` 来优化配置。
注:`'development'` 模式和 `'production'` 模式的用途不同。你可以使用 [操作指南](/guides/production/#setup) 中的 `webpack-merge` 来优化配置。


These plugins can be removed from configuration as they are default in production mode:
生产模式中已经默认了一些插件,这些默认插件可以在配置中被移除:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
生产模式中已经默认了一些插件,这些默认插件可以在配置中被移除
生产模式中已经默认集成了部分插件,这部分默认插件可以在配置中被移除

@@ -97,17 +97,17 @@ module.exports = {
```


## CommonsChunkPlugin
## 公共块插件 (CommonsChunkPlugin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## 公共块插件 (CommonsChunkPlugin
## CommonsChunkPlugin


The `CommonsChunkPlugin` was removed. Instead the [`optimization.splitChunks`](/configuration/optimization/#optimizationsplitchunks) options can be used.
` 公共块插件 (CommonsChunkPlugin)` 已经被移除了。可以使用 [`分割块 (optimization.splitChunks)`](/configuration/optimization/#optimizationsplitchunks) 进行代替。
Copy link
Member

@QC-L QC-L Jun 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
` 公共块插件 (CommonsChunkPlugin)` 已经被移除了。可以使用 [`分割块 (optimization.splitChunks)`](/configuration/optimization/#optimizationsplitchunks) 进行代替
`CommonsChunkPlugin` 已被移除。可以使用 [`optimization.splitChunks`](/configuration/optimization/#optimizationsplitchunks) 来代替


See documentation of the [`optimization.splitChunks`](/configuration/optimization/#optimizationsplitchunks) for more details. The default configuration may already suit your needs.
查看 [`分割块 (optimization.splitChunks)`](/configuration/optimization/#optimizationsplitchunks) 文档可了解更多细节。其默认配置可能已经满足你的需求。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
查看 [`分割块 (optimization.splitChunks)`](/configuration/optimization/#optimizationsplitchunks) 文档可了解更多细节。其默认配置可能已经满足你的需求。
查阅 [`optimization.splitChunks`](/configuration/optimization/#optimizationsplitchunks) 文档了解更多相关细节。其默认配置可能已经满足你的需求。


When using a custom loader to transform `.json` files you now need to change the module `type`:
当使用自定义加载器 (loader) 去转化 `.json` 文件时,你需要更改模块中的 `type`:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
当使用自定义加载器 (loader) 去转化 `.json` 文件时,你需要更改模块中的 `type`:
当使用自定义 loader 去转化 `.json` 文件时,你需要更改模块中的 `type`:

@@ -149,7 +149,7 @@ module.exports = {
};
```

When still using the `json-loader`, it can be removed:
同时使用的 `json-loader` 可以被移除。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
同时使用的 `json-loader` 可以被移除
仍在使用的 `json-loader` 可从项目中移除

@QC-L
Copy link
Member

QC-L commented Jun 22, 2020

赞👍

@QC-L QC-L merged commit 9e43143 into docschina:cn Jun 22, 2020
@QC-L QC-L mentioned this pull request Jun 26, 2020
49 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants