You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/plugins/loader-options-plugin.md
+13-11Lines changed: 13 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -4,26 +4,28 @@ contributors:
4
4
- johnnyreilly
5
5
---
6
6
7
-
?> Review this content
7
+
?> 需要 Review
8
8
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.
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.
*`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`
-`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.
Copy file name to clipboardExpand all lines: generated/plugins/loader-options-plugin.md
+13-11Lines changed: 13 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -4,26 +4,28 @@ contributors:
4
4
- johnnyreilly
5
5
---
6
6
7
-
?> Review this content
7
+
?> 需要 Review
8
8
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.
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.
*`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`
0 commit comments