UNPKG

5.29 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 "type": {
70 "description": "Type of generation",
71 "enum": ["import", "asset"]
72 },
73 "preset": {
74 "description": "Name of preset, i.e. using in '?as=webp'.",
75 "type": "string",
76 "minLength": 1
77 },
78 "implementation": {
79 "description": "Implementation of the generator function.",
80 "instanceof": "Function"
81 },
82 "options": {
83 "description": "Options for the generator function.",
84 "type": "object",
85 "additionalProperties": true
86 },
87 "filter": {
88 "description": "Allows filtering of images.",
89 "instanceof": "Function"
90 },
91 "filename": {
92 "description": "Allows to set the filename for the minimized asset.",
93 "anyOf": [
94 {
95 "type": "string",
96 "minLength": 1
97 },
98 {
99 "instanceof": "Function"
100 }
101 ]
102 }
103 },
104 "required": ["implementation"]
105 }
106 },
107 "type": "object",
108 "additionalProperties": false,
109 "properties": {
110 "test": {
111 "description": "Include all modules that pass test assertion.",
112 "link": "https://github.com/webpack-contrib/image-minimizer-webpack-plugin#test",
113 "oneOf": [
114 {
115 "$ref": "#/definitions/Rules"
116 }
117 ]
118 },
119 "include": {
120 "description": "Include all modules matching any of these conditions.",
121 "link": "https://github.com/webpack-contrib/image-minimizer-webpack-plugin#include",
122 "oneOf": [
123 {
124 "$ref": "#/definitions/Rules"
125 }
126 ]
127 },
128 "exclude": {
129 "description": "Exclude all modules matching any of these conditions.",
130 "link": "https://github.com/webpack-contrib/image-minimizer-webpack-plugin#exclude",
131 "oneOf": [
132 {
133 "$ref": "#/definitions/Rules"
134 }
135 ]
136 },
137 "minimizer": {
138 "description": "Allows you to setup the minimizer function and options.",
139 "link": "https://github.com/webpack-contrib/image-minimizer-webpack-plugin#minimizer",
140 "anyOf": [
141 {
142 "type": "array",
143 "minItems": 1,
144 "items": {
145 "$ref": "#/definitions/Minimizer"
146 }
147 },
148 {
149 "$ref": "#/definitions/Minimizer"
150 }
151 ]
152 },
153 "generator": {
154 "description": "Allows you to setup the generator function and options.",
155 "link": "https://github.com/webpack-contrib/image-minimizer-webpack-plugin#generator",
156 "type": "array",
157 "minItems": 1,
158 "items": {
159 "$ref": "#/definitions/Generator"
160 }
161 },
162 "severityError": {
163 "description": "Allows to choose how errors are displayed.",
164 "link": "https://github.com/webpack-contrib/image-minimizer-webpack-plugin#severityerror",
165 "enum": ["off", "warning", "error"]
166 },
167 "loader": {
168 "description": "Automatically adding `imagemin-loader` (require for minification images using in `url-loader`, `svg-url-loader` or other).",
169 "link": "https://github.com/webpack-contrib/image-minimizer-webpack-plugin#loader",
170 "type": "boolean"
171 },
172 "concurrency": {
173 "description": "Number of concurrency optimization processes in one time.",
174 "link": "https://github.com/webpack-contrib/image-minimizer-webpack-plugin#concurrency",
175 "type": "number"
176 },
177 "deleteOriginalAssets": {
178 "type": "boolean",
179 "description": "Allows to remove original assets after minimization.",
180 "link": "https://github.com/webpack-contrib/image-minimizer-webpack-plugin#deleteoriginalassets"
181 }
182 }
183}