mirror of https://github.com/webpack/webpack.git
Add argument error handling in optimization plugins
This commit is contained in:
parent
bac9b48bfb
commit
7a080e6f24
|
|
@ -3,6 +3,9 @@
|
|||
Author Tobias Koppers @sokra
|
||||
*/
|
||||
function AggressiveMergingPlugin(options) {
|
||||
if(options !== undefined && typeof options !== "object" || Array.isArray(options)) {
|
||||
throw new Error("Argument should be an options object. To use defaults, pass in nothing.\nFor more info on options, see http://webpack.github.io/docs/list-of-plugins.html");
|
||||
}
|
||||
this.options = options || {};
|
||||
}
|
||||
module.exports = AggressiveMergingPlugin;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@
|
|||
Author Tobias Koppers @sokra
|
||||
*/
|
||||
function LimitChunkCountPlugin(options) {
|
||||
if(options !== undefined && typeof options !== "object" || Array.isArray(options)) {
|
||||
throw new Error("Argument should be an options object.\nFor more info on options, see http://webpack.github.io/docs/list-of-plugins.html");
|
||||
}
|
||||
this.options = options || {};
|
||||
}
|
||||
module.exports = LimitChunkCountPlugin;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@
|
|||
Author Tobias Koppers @sokra
|
||||
*/
|
||||
function MinChunkSizePlugin(options) {
|
||||
if(options !== undefined && typeof options !== "object" || Array.isArray(options)) {
|
||||
throw new Error("Argument should be an options object.\nFor more info on options, see http://webpack.github.io/docs/list-of-plugins.html");
|
||||
}
|
||||
this.options = options;
|
||||
}
|
||||
module.exports = MinChunkSizePlugin;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@
|
|||
Author Tobias Koppers @sokra
|
||||
*/
|
||||
function OccurrenceOrderPlugin(preferEntry) {
|
||||
if(preferEntry !== undefined && typeof preferEntry !== "boolean") {
|
||||
throw new Error("Argument should be a boolean.\nFor more info on this plugin, see http://webpack.github.io/docs/list-of-plugins.html");
|
||||
}
|
||||
this.preferEntry = preferEntry;
|
||||
}
|
||||
module.exports = OccurrenceOrderPlugin;
|
||||
|
|
|
|||
Loading…
Reference in New Issue