Skip to content

Commit 47a8cdd

Browse files
Merge pull request webpack#118 from mc-zone/cn
i18n-webpack-plugin; loader-options-plugin
2 parents dc1dc51 + f6755b4 commit 47a8cdd

File tree

3 files changed

+33
-29
lines changed

3 files changed

+33
-29
lines changed

content/plugins/loader-options-plugin.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,28 @@ contributors:
44
- johnnyreilly
55
---
66

7-
?> Review this content
7+
?> 需要 Review
88

9-
The `loader-options-plugin` is unlike other plugins. It exists to help people move from webpack 1 to webpack 2. With webpack 2 the schema for a `webpack.config.js` became stricter; no longer open for extension by other loaders / plugins. With webpack 2 the intention is that you pass `options` directly to loaders / plugins. i.e. options are **not** global / shared.
9+
`loader-options-plugin` 和其他插件不同。它的用途是帮助人们从 webpack 1 迁移至 webpack 2。在 webpack 2 中对 `webpack.config.js` 的结构要求变得更加严格;不再开放扩展给其他的加载器/插件。webpack 2 推荐的使用方式是直接传递 `options` 给加载器/插件。换句话说,配置选项将**不是**全局/共享的。
1010

11-
However, until a loader has been updated to depend upon options being passed directly to them, the `loader-options-plugin` exists to bridge the gap. You can configure global / shared loader options with this plugin and all loaders will receive these options.
11+
不过,在某个加载器升级为依靠直接传递给它的配置选项运行之前,可以使用 `loader-options-plugin` 来抹平差异。你可以通过这个插件配置全局/共享的加载器配置,使所有的加载器都能收到这些配置。
1212

13-
In the future this plugin may be removed.
13+
在将来这个插件可能会被移除。
14+
15+
## 配置
1416

1517
```javascript
1618
new webpack.LoaderOptionsPlugin(options)
1719
```
1820

19-
* `options.debug` (`boolean`): Whether loaders should be in `debug` mode or not. `debug` will be removed as of webpack 3.
20-
* `options.minimize` (`boolean`): Where loaders can be switched to minimize mode.
21-
* `options.options` (`object`): A configuration object that can be used to configure older loaders - this will take the same schema a `webpack.config.js`
21+
* `options.debug` (`boolean`):加载器是否为 `debug` 模式。`debug` webpack 3 中将被移除。
22+
* `options.minimize` (`boolean`):加载器是否要切换到优化模式。
23+
* `options.options` (`object`):一个配置对象,用来配置旧的加载器 - 将使用和 `webpack.config.js` 相同的结构。
2224

23-
* `options.options.context` (`string`): The context that can be used to configure older loaders
24-
* other options as in a `webpack.config.js`....
25+
* `options.options.context` (`string`):配置加载器时使用的上下文。
26+
* 其他选项和在 `webpack.config.js` 中一样……
2527

26-
## Examples
28+
## 示例
2729

2830
```javascript
2931
new webpack.LoaderOptionsPlugin({
@@ -37,4 +39,4 @@ new webpack.LoaderOptionsPlugin({
3739

3840
***
3941

40-
> 原文:https://webpack.js.org/plugins/loader-options-plugin/
42+
> 原文:https://webpack.js.org/plugins/loader-options-plugin/

generated/plugins/i18n-webpack-plugin.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@ edit: https://github.com/webpack/i18n-webpack-plugin/edit/master/README.md
55
---
66
# i18n plugin for webpack
77

8-
## Usage
8+
## 用法
99

10-
see [webpack/webpack/examples/i18n](https://github.com/webpack/webpack/tree/master/examples/i18n).
10+
参考 [webpack/webpack/examples/i18n](https://github.com/webpack/webpack/tree/master/examples/i18n)
1111

12-
## Options
12+
## 配置
1313

1414
```
1515
plugins: [
1616
...
1717
new I18nPlugin(languageConfig, optionsObj)
1818
],
1919
```
20-
- `optionsObj.functionName`: the default value is `__`, you can change it to other function name.
21-
- `optionsObj.failOnMissing`: the default value is `false`, which will show a warning message, if the mapping text cannot be found. If set to `true`, the message will be an error message.
22-
- `optionsObj.hideMessage`: the default value is `false`, which will show the warning/error message. If set to `true`, the message will be hide.
20+
- `optionsObj.functionName`:默认值为 `__`, 你可以更改为其他函数名。
21+
- `optionsObj.failOnMissing`:默认值为 `false`,找不到映射文本(mapping text)时会给出一个警告信息,如果设置为 `true`,则会给出一个错误信息。
22+
- `optionsObj.hideMessage`:默认值为 `false`,将会显示警告/错误信息。如果设置为 `true`,警告/错误信息将会被隐藏。
2323

2424
## License
2525

2626
MIT (http://www.opensource.org/licenses/mit-license.php)
2727

2828
***
2929

30-
> 原文:https://webpack.js.org/plugins/i18n-webpack-plugin/
30+
> 原文:https://webpack.js.org/plugins/i18n-webpack-plugin/

generated/plugins/loader-options-plugin.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,28 @@ contributors:
44
- johnnyreilly
55
---
66

7-
?> Review this content
7+
?> 需要 Review
88

9-
The `loader-options-plugin` is unlike other plugins. It exists to help people move from webpack 1 to webpack 2. With webpack 2 the schema for a `webpack.config.js` became stricter; no longer open for extension by other loaders / plugins. With webpack 2 the intention is that you pass `options` directly to loaders / plugins. i.e. options are **not** global / shared.
9+
`loader-options-plugin` 和其他插件不同。它的用途是帮助人们从 webpack 1 迁移至 webpack 2。在 webpack 2 中对 `webpack.config.js` 的结构要求变得更加严格;不再开放扩展给其他的加载器/插件。webpack 2 推荐的使用方式是直接传递 `options` 给加载器/插件。换句话说,配置选项将**不是**全局/共享的。
1010

11-
However, until a loader has been updated to depend upon options being passed directly to them, the `loader-options-plugin` exists to bridge the gap. You can configure global / shared loader options with this plugin and all loaders will receive these options.
11+
不过,在某个加载器升级为依靠直接传递给它的配置选项运行之前,可以使用 `loader-options-plugin` 来抹平差异。你可以通过这个插件配置全局/共享的加载器配置,使所有的加载器都能收到这些配置。
1212

13-
In the future this plugin may be removed.
13+
在将来这个插件可能会被移除。
14+
15+
## 配置
1416

1517
```javascript
1618
new webpack.LoaderOptionsPlugin(options)
1719
```
1820

19-
* `options.debug` (`boolean`): Whether loaders should be in `debug` mode or not. `debug` will be removed as of webpack 3.
20-
* `options.minimize` (`boolean`): Where loaders can be switched to minimize mode.
21-
* `options.options` (`object`): A configuration object that can be used to configure older loaders - this will take the same schema a `webpack.config.js`
21+
* `options.debug` (`boolean`):加载器是否为 `debug` 模式。`debug` webpack 3 中将被移除。
22+
* `options.minimize` (`boolean`):加载器是否要切换到优化模式。
23+
* `options.options` (`object`):一个配置对象,用来配置旧的加载器 - 将使用和 `webpack.config.js` 相同的结构。
2224

23-
* `options.options.context` (`string`): The context that can be used to configure older loaders
24-
* other options as in a `webpack.config.js`....
25+
* `options.options.context` (`string`):配置加载器时使用的上下文。
26+
* 其他选项和在 `webpack.config.js` 中一样……
2527

26-
## Examples
28+
## 示例
2729

2830
```javascript
2931
new webpack.LoaderOptionsPlugin({
@@ -37,4 +39,4 @@ new webpack.LoaderOptionsPlugin({
3739

3840
***
3941

40-
> 原文:https://webpack.js.org/plugins/loader-options-plugin/
42+
> 原文:https://webpack.js.org/plugins/loader-options-plugin/

0 commit comments

Comments
 (0)