Skip to content

docs(cn): translate src/content/migrate/3.md #781

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 9 commits into from
Jun 30, 2020

Conversation

miazhuce
Copy link

@miazhuce miazhuce commented Jun 24, 2020

describe your changes...
从 v1 升级到 v2 或 v3 @dear-lizhihua

  • Read and sign the CLA. PRs that haven't signed it won't be accepted.
  • Make sure your PR complies with the writer's guide.
  • Review the diff carefully as sometimes this can reveal issues.
  • Do not abandon your Pull Request: Stale Pull Requests.
  • Remove these instructions from your PR as they are for your eyes only.

@netlify
Copy link

netlify bot commented Jun 24, 2020

Deploy preview for cn-webpack ready!

Built with commit f0ad559

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


T> Note that there were far fewer changes between 2 and 3, so that migration shouldn't be too bad. If you are running into issues, please see [the changelog](https://github.com/webpack/webpack/releases) for details.
T> 注意:webpack 从 1 到 2 的变化,比从 2 到 3 要少很多,所以版本迁移起来难度应该不大。如果你遇到了问题,请查看 [更新日志](https://github.com/webpack/webpack/releases) 以了解更多细节。

Choose a reason for hiding this comment

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

请保证中英文的行数都保持一致

Copy link
Author

Choose a reason for hiding this comment

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

修改完成提交

## `module.loaders` is now `module.rules`
## `module.loaders` 升级为 `module.rules`

旧的 loader 配置被更强大的 rules 系统取代,后者允许配置 loader 以及其他更多选项。 为了兼容旧版,`module.loaders` 语法仍然有效,旧的属性名依然可以被解析。 新的命名约定更易于理解,并且是升级配置使用 `module.rules` 的好理由。

Choose a reason for hiding this comment

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

行数请保持一致了

Copy link
Author

Choose a reason for hiding this comment

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

修改完成提交


Good question. Well, strictly speaking it's 2 possible things; both ways to configure a webpack loader. Classically `options` was called `query` and was a string which could be appended to the name of the loader. Much like a query string but actually with [greater powers](https://github.com/webpack/loader-utils#parsequery):
好问题。严格来说,有两种办法,都可以用来配置 webpack loader 。典型的 `options` 被称为 `query`,是一个可以被添加到 loader 名之后的字符串。它比较像一个 query string,但是实际上有[更强大的能力](https://github.com/webpack/loader-utils#parsequery):

Choose a reason for hiding this comment

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

query string -> 查询字符串(query string)

Copy link
Author

Choose a reason for hiding this comment

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

修改完成提交

issuer: /filename/, // matches "/path/something.js" if requested from "/path/filename.js"
resource: /filename/, // 匹配 "/path/filename.js"
resourceQuery: /^\?querystring$/, // 匹配 "?querystring"
issuer: /filename/, // 果请求 "/path/filename.js" 则匹配 "/path/something.js"

Choose a reason for hiding this comment

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

如果

Copy link
Author

Choose a reason for hiding this comment

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

修改完成提交

@QC-L QC-L mentioned this pull request Jun 26, 2020
49 tasks
@QC-L QC-L changed the title Feature/diff mia docs(cn): translate src/content/migrate/3.md Jun 26, 2020
## `json-loader` is not required anymore
## `json-loader` 不再需要手动添加

如果没有为 JSON 文件配置 loader,webpack 将自动尝试通过 [`json-loader`](https://github.com/webpack-contrib/json-loader) 加载 JSON 文件。

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
Author

Choose a reason for hiding this comment

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

done

wangyage and others added 2 commits June 30, 2020 14:03
@QC-L QC-L merged commit 7563d26 into docschina:cn Jun 30, 2020
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.

3 participants