UNPKG

image-minimizer-webpack-plugin

Version:

Webpack loader and plugin to optimize (compress) images using imagemin

184 lines (183 loc) 5.29 kB
{ "definitions": { "Rule": { "description": "Filtering rule as regex or string.", "anyOf": [ { "instanceof": "RegExp" }, { "type": "string", "minLength": 1 } ] }, "Rules": { "description": "Filtering rules.", "anyOf": [ { "type": "array", "items": { "description": "A rule condition.", "oneOf": [ { "$ref": "#/definitions/Rule" } ] } }, { "$ref": "#/definitions/Rule" } ] }, "Minimizer": { "type": "object", "additionalProperties": false, "properties": { "implementation": { "description": "Implementation of the minimizer function.", "instanceof": "Function" }, "filter": { "description": "Allows filtering of images.", "instanceof": "Function" }, "filename": { "description": "Allows to set the filename for the minimized asset.", "anyOf": [ { "type": "string", "minLength": 1 }, { "instanceof": "Function" } ] }, "options": { "description": "Options for the minimizer function.", "type": "object", "additionalProperties": true } } }, "Generator": { "type": "object", "additionalProperties": false, "properties": { "type": { "description": "Type of generation", "enum": ["import", "asset"] }, "preset": { "description": "Name of preset, i.e. using in '?as=webp'.", "type": "string", "minLength": 1 }, "implementation": { "description": "Implementation of the generator function.", "instanceof": "Function" }, "options": { "description": "Options for the generator function.", "type": "object", "additionalProperties": true }, "filter": { "description": "Allows filtering of images.", "instanceof": "Function" }, "filename": { "description": "Allows to set the filename for the minimized asset.", "anyOf": [ { "type": "string", "minLength": 1 }, { "instanceof": "Function" } ] } }, "required": ["implementation"] } }, "type": "object", "additionalProperties": false, "properties": { "test": { "description": "Include all modules that pass test assertion.", "link": "https://github.com/webpack-contrib/image-minimizer-webpack-plugin#test", "oneOf": [ { "$ref": "#/definitions/Rules" } ] }, "include": { "description": "Include all modules matching any of these conditions.", "link": "https://github.com/webpack-contrib/image-minimizer-webpack-plugin#include", "oneOf": [ { "$ref": "#/definitions/Rules" } ] }, "exclude": { "description": "Exclude all modules matching any of these conditions.", "link": "https://github.com/webpack-contrib/image-minimizer-webpack-plugin#exclude", "oneOf": [ { "$ref": "#/definitions/Rules" } ] }, "minimizer": { "description": "Allows you to setup the minimizer function and options.", "link": "https://github.com/webpack-contrib/image-minimizer-webpack-plugin#minimizer", "anyOf": [ { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/Minimizer" } }, { "$ref": "#/definitions/Minimizer" } ] }, "generator": { "description": "Allows you to setup the generator function and options.", "link": "https://github.com/webpack-contrib/image-minimizer-webpack-plugin#generator", "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/Generator" } }, "severityError": { "description": "Allows to choose how errors are displayed.", "link": "https://github.com/webpack-contrib/image-minimizer-webpack-plugin#severityerror", "enum": ["off", "warning", "error"] }, "loader": { "description": "Automatically adding `imagemin-loader` (require for minification images using in `url-loader`, `svg-url-loader` or other).", "link": "https://github.com/webpack-contrib/image-minimizer-webpack-plugin#loader", "type": "boolean" }, "concurrency": { "description": "Number of concurrency optimization processes in one time.", "link": "https://github.com/webpack-contrib/image-minimizer-webpack-plugin#concurrency", "type": "number" }, "deleteOriginalAssets": { "type": "boolean", "description": "Allows to remove original assets after minimization.", "link": "https://github.com/webpack-contrib/image-minimizer-webpack-plugin#deleteoriginalassets" } } }