-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Conversation
Deploy preview for cn-webpack ready! Built with commit f0ad559 |
src/content/migrate/3.md
Outdated
|
||
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) 以了解更多细节。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请保证中英文的行数都保持一致
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修改完成提交
src/content/migrate/3.md
Outdated
## `module.loaders` is now `module.rules` | ||
## `module.loaders` 升级为 `module.rules` | ||
|
||
旧的 loader 配置被更强大的 rules 系统取代,后者允许配置 loader 以及其他更多选项。 为了兼容旧版,`module.loaders` 语法仍然有效,旧的属性名依然可以被解析。 新的命名约定更易于理解,并且是升级配置使用 `module.rules` 的好理由。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
行数请保持一致了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修改完成提交
src/content/migrate/3.md
Outdated
|
||
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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
query string -> 查询字符串(query string)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修改完成提交
src/content/migrate/3.md
Outdated
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修改完成提交
src/content/migrate/3.md
Outdated
## `json-loader` is not required anymore | ||
## `json-loader` 不再需要手动添加 | ||
|
||
如果没有为 JSON 文件配置 loader,webpack 将自动尝试通过 [`json-loader`](https://github.com/webpack-contrib/json-loader) 加载 JSON 文件。 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
多余的空行请删掉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
describe your changes...
从 v1 升级到 v2 或 v3 @dear-lizhihua