forked from HookyQR/VSCodeMinify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
executable file
·683 lines (683 loc) · 22.2 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
{
"name": "minify",
"displayName": "Minify",
"description": "Minify for VS Code.\nMinify with command, and (optionally) re-minify on save.",
"version": "0.4.3",
"publisher": "HookyQR",
"engines": {
"vscode": "^1.6.0"
},
"categories": [
"Other"
],
"activationEvents": [
"*"
],
"icon": "icon.png",
"galleryBanner": {
"color": "#e8e030",
"theme": "light"
},
"main": "./extension",
"contributes": {
"commands": [
{
"command": "HookyQR.minify",
"title": "Minify"
},
{
"command": "HookyQR.minifyDir",
"title": "Minify Directory"
}
],
"configuration": {
"type": "object",
"title": "Minify config",
"properties": {
"minify.minifyExistingOnSave": {
"type": "boolean",
"default": false,
"description": "Minify file on save if a related (.min.[ext]) file already exists. Includes directory minification/"
},
"minify.js": {
"type": "object",
"description": "Settings specific to Javascript minification. Tool tips and completion are provided when editing your settings.",
"default": {
"mangle": true,
"compress": {
"sequences": true,
"properties": true,
"dead_code": true,
"drop_debugger": true,
"unsafe": false,
"unsafe_comps": false,
"conditionals": true,
"comparisons": true,
"evaluate": true,
"booleans": true,
"loops": true,
"unused": true,
"hoist_funs": true,
"keep_fargs": true,
"keep_fnames": false,
"hoist_vars": false,
"if_return": true,
"join_vars": true,
"collapse_vars": false,
"reduce_vars": false,
"side_effects": true,
"pure_getters": false,
"pure_funcs": null,
"negate_iife": false,
"drop_console": false,
"passes": 1,
"global_defs": {}
},
"output": {
"ascii_only": false,
"inline_script": false,
"max_line_len": 32000,
"braces": false,
"semicolons": true,
"comments": false,
"shebang": true,
"preamble": null,
"quote_style": "best"
}
},
"properties": {
"mangle": {
"type": "boolean",
"default": true,
"description": "[UglifyJS] mangle non-toplevel function and variable (including argument) names"
},
"compress": {
"type": "object",
"description": "Compressor settings",
"properties": {
"sequences": {
"type": "boolean",
"default": true,
"description": "join consecutive simple statements using the comma operator"
},
"properties": {
"type": "boolean",
"default": true,
"description": "rewrite property access using the dot notation, for example foo['bar'] → foo.bar"
},
"dead_code": {
"type": "boolean",
"default": true,
"description": "remove unreachable code"
},
"drop_debugger": {
"type": "boolean",
"default": true,
"description": "remove `debugger;` statements"
},
"unsafe": {
"type": "boolean",
"default": false,
"description": "apply \"unsafe\" transformations. See http://lisperator.net/uglifyjs/"
},
"unsafe_comps": {
"type": "boolean",
"default": false,
"description": "reverse < and <= to > and >= to allow improved compression."
},
"conditionals": {
"type": "boolean",
"default": true,
"description": "apply optimizations for if-s and conditional expressions"
},
"comparisons": {
"type": "boolean",
"default": true,
"description": "apply certain optimizations to binary nodes, for example: !(a <= b) → a > b (only when unsafe), attempts to negate binary nodes, e.g. a = !b && !c && !d && !e → a=!(b||c||d||e) etc."
},
"evaluate": {
"type": "boolean",
"default": true,
"description": "attempt to evaluate constant expressions"
},
"booleans": {
"type": "boolean",
"default": true,
"description": "various optimizations for boolean context, for example !!a ? b : c → a ? b : c"
},
"loops": {
"type": "boolean",
"default": true,
"description": "optimizations for do, while and for loops when we can statically determine the condition"
},
"unused": {
"type": "boolean",
"default": true,
"description": "drop unreferenced functions and variables"
},
"hoist_funs": {
"type": "boolean",
"default": true,
"description": "hoist function declarations"
},
"keep_fargs": {
"type": "boolean",
"default": true,
"description": "prevents the compressor from discarding unused function arguments. You need this for code which relies on `Function.length`"
},
"keep_fnames": {
"type": "boolean",
"default": false,
"description": "pass true to prevent the compressor from mangling/discarding function names. Useful for code relying on Function.prototype.name."
},
"hoist_vars": {
"type": "boolean",
"default": false,
"description": "hoist var declarations (this is false by default because it seems to increase the size of the output in general)"
},
"if_return": {
"type": "boolean",
"default": true,
"description": "optimizations for if/return and if/continue"
},
"join_vars": {
"type": "boolean",
"default": true,
"description": "join consecutive var statements"
},
"collapse_vars": {
"type": "boolean",
"default": false,
"description": "Collapse single-use var and const definitions when possible."
},
"reduce_vars": {
"type": "boolean",
"default": false,
"description": "improve optimization on variables assigned with and used as constant values."
},
"side_effects": {
"type": "boolean",
"default": true,
"description": "drop side-effect-free statements"
},
"pure_getters": {
"type": "boolean",
"default": false,
"description": "if you pass true for this, UglifyJS will assume that object property access (e.g. foo.bar or foo[\"bar\"]) doesn't have any side effects"
},
"pure_funcs": {
"type": [
"array",
"null"
],
"default": null,
"description": "an array of function names that UglifyJS will assume do not produce side effects."
},
"negate_iife": {
"type": "boolean",
"default": false,
"description": "negate \"Immediately-Called Function Expressions\" where the return value is discarded, to avoid the parens that the code generator would insert."
},
"drop_console": {
"type": "boolean",
"default": false,
"description": "pass true to discard calls to console.* functions."
},
"passes": {
"type": "integer",
"default": 1,
"description": "number of times to run compress. Use an integer argument larger than 1 to further reduce code size in some cases. Note: raising the number of passes will increase uglify compress time."
},
"global_defs": {
"type": "object",
"default": {},
"description": "global definitions"
}
}
},
"output": {
"type": "object",
"description": "Compressor settings",
"properties": {
"ascii_only": {
"type": "boolean",
"default": false,
"description": "escape Unicode characters in strings and regexps (affects directives with non-ascii characters becoming invalid)"
},
"inline_script": {
"type": "boolean",
"default": false,
"description": "escape the slash in occurrences of `</script` in strings"
},
"max_line_len": {
"type": "integer",
"default": 32000,
"description": "maximum line length for uglified code"
},
"braces": {
"type": "boolean",
"default": false,
"description": "always insert brackets in `if`, `for`, `do`, `while` or `with` statements, even if their body is a single statement."
},
"semicolons": {
"type": "boolean",
"default": true,
"description": "separate statements with semicolons. If set to 'false' then whenever possible a newline will be inserted instead of a semicolon, leading to more readable output of uglified code (size before gzip could be smaller; size after gzip insignificantly larger)."
},
"comments": {
"type": [
"boolean",
"string"
],
"default": false,
"description": "Preserve comments:\n - \"all\" or `true` will keep all comments;\n - \"some\" will keep multi-line comments containing '@license', '@preserve', or '@cc_on';\n - A valid JS RegExp (as a string) like '/foo/i' or '/^!/' will keep matching multi-line comments."
},
"shebang": {
"type": "boolean",
"default": true,
"description": "preserve the shebang at the start of the file"
},
"preamble": {
"type": [
"string",
"null"
],
"default": null,
"description": "Preamble to prepend to the output. You can use this to insert a comment, for example for licensing information."
},
"quote_style": {
"type": "string",
"enum": [
"best",
"single",
"double",
"original"
],
"default": "best",
"description": "quite style to use, by default double quotes are used unless the string contains double quotes"
}
}
}
}
},
"minify.css": {
"type": "object",
"description": "Settings specific to CSS minification. Tool tips and completion are provided when editing your settings.",
"default": {
"advanced": true,
"aggressiveMerging": true,
"compatibility": "*",
"inliner": {},
"keepBreaks": false,
"keepSpecialComments": "*",
"mediaMerging": true,
"processImport": true,
"processImportFrom": [
"all"
],
"rebase": true,
"restructuring": true,
"root": "${workspaceRoot}",
"roundingPrecision": 2,
"semanticMerging": false,
"shorthandCompacting": true
},
"properties": {
"advanced": {
"type": "boolean",
"default": true,
"description": "set to false to disable advanced optimizations - selector & property merging, reduction, etc."
},
"aggressiveMerging": {
"type": "boolean",
"default": true,
"description": "set to false to disable aggressive merging of properties."
},
"compatibility": {
"type": "string",
"default": "*",
"description": "enables compatibility mode, see https://github.com/jakubpawlowicz/clean-css#how-to-set-a-compatibility-mode"
},
"inliner": {
"type": "object",
"default": {},
"description": "a hash of options for @import inliner, see https://github.com/jakubpawlowicz/clean-css/blob/master/test/protocol-imports-test.js#L372 for examples"
},
"keepBreaks": {
"type": "boolean",
"default": false,
"description": "whether to keep line breaks"
},
"keepSpecialComments": {
"type": [
"string",
"integer"
],
"enum": [
"*",
1,
0
],
"default": "*",
"description": "* for keeping all (default), 1 for keeping first one only, 0 for removing all"
},
"mediaMerging": {
"type": "boolean",
"default": true,
"description": "whether to merge @media at-rules (default is true)"
},
"processImport": {
"type": "boolean",
"default": true,
"description": "whether to process @import rules"
},
"processImportFrom": {
"type": "array",
"default": [
"all"
],
"description": "a list of @import rules, can be ['all'] (default), ['local'], ['remote'], or a blacklisted path e.g. ['!fonts.googleapis.com']"
},
"rebase": {
"type": "boolean",
"default": true,
"description": "set to false to skip URL rebasing"
},
"restructuring": {
"type": "boolean",
"default": true,
"description": "set to false to disable restructuring in advanced optimizations"
},
"root": {
"type": "string",
"default": "${workspaceRoot}",
"description": "path to resolve absolute @import rules and rebase relative URLs"
},
"roundingPrecision": {
"type": "integer",
"default": 2,
"description": "rounding precision; defaults to 2; -1 disables rounding"
},
"semanticMerging": {
"type": "boolean",
"default": false,
"description": "set to true to enable semantic merging mode which assumes BEM-like content (default is false as it's highly likely this will break your stylesheets - use with caution!)"
},
"shorthandCompacting": {
"type": "boolean",
"default": true,
"description": "set to false to skip shorthand compacting (default is true unless sourceMap is set when it's false)"
}
}
},
"minify.html": {
"type": "object",
"description": "Settings specific to HTML minification. Tool tips and completion are provided when editing your settings.",
"default": {
"caseSensitive": false,
"collapseBooleanAttributes": true,
"collapseInlineTagWhitespace": false,
"collapseWhitespace": true,
"conservativeCollapse": false,
"customAttrAssign": [],
"customAttrCollapse": "",
"customAttrSurround": [],
"customEventAttributes": [
"^on[a-z]{3,}$"
],
"decodeEntities": false,
"html5": true,
"ignoreCustomComments": [
"^!"
],
"ignoreCustomFragments": [
"<%[\\s\\S]*?%>",
"<\\?[\\s\\S]*?\\?>"
],
"includeAutoGeneratedTags": true,
"keepClosingSlash": false,
"maxLineLength": false,
"minifyCSS": true,
"minifyJS": true,
"minifyURLs": false,
"preserveLineBreaks": false,
"preventAttributesEscaping": false,
"processConditionalComments": false,
"processScripts": [],
"quoteCharacter": "\"",
"removeAttributeQuotes": false,
"removeComments": false,
"removeEmptyAttributes": false,
"removeEmptyElements": false,
"removeOptionalTags": false,
"removeRedundantAttributes": false,
"removeScriptTypeAttributes": false,
"removeStyleLinkTypeAttributes": false,
"sortAttributes": false,
"sortClassName": false,
"trimCustomFragments": false,
"useShortDoctype": false
},
"properties": {
"caseSensitive": {
"type": "boolean",
"default": false,
"description": "Treat attributes in case sensitive manner (useful for custom HTML tags.)"
},
"collapseBooleanAttributes": {
"type": "boolean",
"default": true,
"description": "Omit attribute values from boolean attributes"
},
"collapseInlineTagWhitespace": {
"type": "boolean",
"default": false,
"description": "Don't leave any spaces between display:inline; elements when collapsing. Must be used in conjunction with collapseWhitespace=true."
},
"collapseWhitespace": {
"type": "boolean",
"default": true,
"description": "Collapse white space that contributes to text nodes in a document tree."
},
"conservativeCollapse": {
"type": "boolean",
"default": false,
"description": "Always collapse to 1 space (never remove it entirely). Must be used in conjunction with \"collapseWhitespace\":true"
},
"customAttrAssign": {
"type": "array",
"default": [],
"description": "Arrays of regex'es that allow to support custom attribute assign expressions (e.g. '<div flex?=\"{{mode != cover}}\"></div>')"
},
"customAttrCollapse": {
"type": "string",
"default": "",
"description": "Regex that specifies custom attribute to strip newlines from (e.g. \"ng\\-class/\")"
},
"customAttrSurround": {
"type": "array",
"default": [],
"description": "Arrays of regex'es that allow to support custom attribute surround expressions (e.g. <input {{#if value}}checked=\"checked\"{{/if}}>)"
},
"customEventAttributes": {
"type": "array",
"default": [
"^on[a-z]{3,}$"
],
"description": "Arrays of regex'es that allow to support custom event attributes for minifyJS (e.g. ng-click)"
},
"decodeEntities": {
"type": "boolean",
"default": false,
"description": "Use direct Unicode characters whenever possible"
},
"html5": {
"type": "boolean",
"default": true,
"description": "Parse input according to HTML5 specifications"
},
"ignoreCustomComments": {
"type": "array",
"default": [
"^!"
],
"description": "Array of regex'es that allow to ignore certain comments, when matched"
},
"ignoreCustomFragments": {
"type": "array",
"default": [
"<%[\\s\\S]*?%>",
"<\\?[\\s\\S]*?\\?>"
],
"description": "Array of regex'es that allow to ignore certain fragments, when matched (e.g. <?php ... ?>, {{ ... }}, etc.)"
},
"includeAutoGeneratedTags": {
"type": "boolean",
"default": true,
"description": "Insert tags generated by HTML parser"
},
"keepClosingSlash": {
"type": "boolean",
"default": false,
"description": "Keep the trailing slash on singleton elements"
},
"maxLineLength": {
"type": [
"boolean",
"integer"
],
"default": false,
"description": "Specify a maximum line length. Compressed output will be split by newlines at valid HTML split-points."
},
"minifyCSS": {
"type": [
"boolean",
"object"
],
"default": true,
"description": "Minify CSS in style elements and style attributes (uses clean-css)"
},
"minifyJS": {
"type": [
"boolean",
"object"
],
"default": true,
"description": "Minify Javascript in script elements and on* attributes (uses UglifyJS)"
},
"minifyURLs": {
"type": [
"boolean",
"object"
],
"default": false,
"description": "Minify URLs in various attributes (uses relateurl) see https://github.com/stevenvachon/relateurl"
},
"preserveLineBreaks": {
"type": "boolean",
"default": false,
"description": "Always collapse to 1 line break (never remove it entirely) when whitespace between tags include a line break. Must be used in conjunction with \"collapseWhitespace\":true"
},
"preventAttributesEscaping": {
"type": "boolean",
"default": false,
"description": "Prevents the escaping of the values of attributes."
},
"processConditionalComments": {
"type": "boolean",
"default": false,
"description": "Process contents of conditional comments through minifier"
},
"processScripts": {
"type": "array",
"default": [],
"description": "Array of strings corresponding to types of script elements to process through minifier (e.g. text/ng-template, text/x-handlebars-template, etc.)"
},
"quoteCharacter": {
"type": "string",
"default": "\"",
"maxLength": 1,
"description": "Type of quote to use for attribute values (' or \")"
},
"removeAttributeQuotes": {
"type": "boolean",
"default": false,
"description": "Remove quotes around attributes when possible."
},
"removeComments": {
"type": "boolean",
"default": false,
"description": "Strip HTML comments"
},
"removeEmptyAttributes": {
"type": "boolean",
"default": false,
"description": "Remove all attributes with whitespace-only values"
},
"removeEmptyElements": {
"type": "boolean",
"default": false,
"description": "Remove all elements with empty contents"
},
"removeOptionalTags": {
"type": "boolean",
"default": false,
"description": "Remove unrequired tags"
},
"removeRedundantAttributes": {
"type": "boolean",
"default": false,
"description": "Remove attributes when value matches default."
},
"removeScriptTypeAttributes": {
"type": "boolean",
"default": false,
"description": "Remove type=\"text/javascript\" from script tags. Other type attribute values are left intact."
},
"removeStyleLinkTypeAttributes": {
"type": "boolean",
"default": false,
"description": "Remove type=\"text/css\" from style and link tags. Other type attribute values are left intact."
},
"sortAttributes": {
"type": "boolean",
"default": false,
"description": "Sort attributes by frequency"
},
"sortClassName": {
"type": "boolean",
"default": false,
"description": "Sort style classes by frequency"
},
"trimCustomFragments": {
"type": "boolean",
"default": false,
"description": "Trim white space around `ignoreCustomFragments`"
},
"useShortDoctype": {
"type": "boolean",
"default": false,
"description": "Replaces the doctype with the short (HTML5) doctype"
}
}
}
}
}
},
"devDependencies": {
"vscode": "~1.1.30"
},
"license": "MIT",
"dependencies": {
"terser": "^3.17.0",
"clean-css": ">=3.4.19",
"html-minifier": ">=3.0.2"
},
"repository": {
"type": "git",
"url": "https://github.com/HookyQR/VSCodeMinify"
},
"bugs": {
"url": "https://github.com/HookyQR/VSCodeMinify/issues"
}
}