UNPKG

5.18 kBJSONView Raw
1{
2 "definitions": {
3 "Rule": {
4 "description": "Filtering rule as regex or string.",
5 "anyOf": [
6 {
7 "instanceof": "RegExp"
8 },
9 {
10 "type": "string",
11 "minLength": 1
12 }
13 ]
14 },
15 "Rules": {
16 "description": "Filtering rules.",
17 "anyOf": [
18 {
19 "type": "array",
20 "items": {
21 "description": "A rule condition.",
22 "oneOf": [
23 {
24 "$ref": "#/definitions/Rule"
25 }
26 ]
27 }
28 },
29 {
30 "$ref": "#/definitions/Rule"
31 }
32 ]
33 },
34 "Minimizer": {
35 "type": "object",
36 "additionalProperties": false,
37 "properties": {
38 "implementation": {
39 "description": "Implementation of the minimizer function.",
40 "instanceof": "Function"
41 },
42 "filter": {
43 "description": "Allows filtering of images.",
44 "instanceof": "Function"
45 },
46 "filename": {
47 "description": "Allows to set the filename for the minimized asset.",
48 "anyOf": [
49 {
50 "type": "string",
51 "minLength": 1
52 },
53 {
54 "instanceof": "Function"
55 }
56 ]
57 },
58 "options": {
59 "description": "Options for the minimizer function.",
60 "type": "object",
61 "additionalProperties": true
62 }
63 }
64 },
65 "Generator": {
66 "type": "object",
67 "additionalProperties": false,
68 "properties": {
69 "preset": {
70 "description": "Name of preset, i.e. using in '?as=webp'.",
71 "type": "string",
72 "minLength": 1
73 },
74 "implementation": {
75 "description": "Implementation of the generator function.",
76 "instanceof": "Function"
77 },
78 "options": {
79 "description": "Options for the generator function.",
80 "type": "object",
81 "additionalProperties": true
82 },
83 "filter": {
84 "description": "Allows filtering of images.",
85 "instanceof": "Function"
86 },
87 "filename": {
88 "description": "Allows to set the filename for the minimized asset.",
89 "anyOf": [
90 {
91 "type": "string",
92 "minLength": 1
93 },
94 {
95 "instanceof": "Function"
96 }
97 ]
98 }
99 },
100 "required": ["implementation", "preset"]
101 }
102 },
103 "type": "object",
104 "additionalProperties": false,
105 "properties": {
106 "test": {
107 "description": "Include all modules that pass test assertion.",
108 "link": "https://github.com/webpack-contrib/image-minimizer-webpack-plugin#test",
109 "oneOf": [
110 {
111 "$ref": "#/definitions/Rules"
112 }
113 ]
114 },
115 "include": {
116 "description": "Include all modules matching any of these conditions.",
117 "link": "https://github.com/webpack-contrib/image-minimizer-webpack-plugin#include",
118 "oneOf": [
119 {
120 "$ref": "#/definitions/Rules"
121 }
122 ]
123 },
124 "exclude": {
125 "description": "Exclude all modules matching any of these conditions.",
126 "link": "https://github.com/webpack-contrib/image-minimizer-webpack-plugin#exclude",
127 "oneOf": [
128 {
129 "$ref": "#/definitions/Rules"
130 }
131 ]
132 },
133 "minimizer": {
134 "description": "Allows you to setup the minimizer function and options.",
135 "link": "https://github.com/webpack-contrib/image-minimizer-webpack-plugin#minimizer",
136 "anyOf": [
137 {
138 "type": "array",
139 "minItems": 1,
140 "items": {
141 "$ref": "#/definitions/Minimizer"
142 }
143 },
144 {
145 "$ref": "#/definitions/Minimizer"
146 }
147 ]
148 },
149 "generator": {
150 "description": "Allows you to setup the generator function and options.",
151 "link": "https://github.com/webpack-contrib/image-minimizer-webpack-plugin#generator",
152 "type": "array",
153 "minItems": 1,
154 "items": {
155 "$ref": "#/definitions/Generator"
156 }
157 },
158 "severityError": {
159 "description": "Allows to choose how errors are displayed.",
160 "link": "https://github.com/webpack-contrib/image-minimizer-webpack-plugin#severityerror",
161 "enum": ["off", "warning", "error"]
162 },
163 "loader": {
164 "description": "Automatically adding `imagemin-loader` (require for minification images using in `url-loader`, `svg-url-loader` or other).",
165 "link": "https://github.com/webpack-contrib/image-minimizer-webpack-plugin#loader",
166 "type": "boolean"
167 },
168 "concurrency": {
169 "description": "Number of concurrency optimization processes in one time.",
170 "link": "https://github.com/webpack-contrib/image-minimizer-webpack-plugin#concurrency",
171 "type": "number"
172 },
173 "deleteOriginalAssets": {
174 "type": "boolean",
175 "description": "Allows to remove original assets after minimization.",
176 "link": "https://github.com/webpack-contrib/image-minimizer-webpack-plugin#deleteoriginalassets"
177 }
178 }
179}