options.json 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. {
  2. "additionalProperties": false,
  3. "definitions": {
  4. "Rule": {
  5. "description": "Filtering rule as regex or string.",
  6. "anyOf": [
  7. {
  8. "instanceof": "RegExp",
  9. "tsType": "RegExp"
  10. },
  11. {
  12. "type": "string",
  13. "minLength": 1
  14. }
  15. ]
  16. },
  17. "Rules": {
  18. "description": "Filtering rules.",
  19. "anyOf": [
  20. {
  21. "type": "array",
  22. "items": {
  23. "description": "A rule condition.",
  24. "oneOf": [
  25. {
  26. "$ref": "#/definitions/Rule"
  27. }
  28. ]
  29. }
  30. },
  31. {
  32. "$ref": "#/definitions/Rule"
  33. }
  34. ]
  35. }
  36. },
  37. "properties": {
  38. "test": {
  39. "description": "Include all assets that pass test assertion.",
  40. "oneOf": [
  41. {
  42. "$ref": "#/definitions/Rules"
  43. }
  44. ]
  45. },
  46. "include": {
  47. "description": "Include all assets matching any of these conditions.",
  48. "oneOf": [
  49. {
  50. "$ref": "#/definitions/Rules"
  51. }
  52. ]
  53. },
  54. "exclude": {
  55. "description": "Exclude all assets matching any of these conditions.",
  56. "oneOf": [
  57. {
  58. "$ref": "#/definitions/Rules"
  59. }
  60. ]
  61. },
  62. "algorithm": {
  63. "description": "The compression algorithm/function.",
  64. "anyOf": [
  65. {
  66. "type": "string"
  67. },
  68. {
  69. "instanceof": "Function"
  70. }
  71. ]
  72. },
  73. "compressionOptions": {
  74. "description": "Compression options for `algorithm`.",
  75. "additionalProperties": true,
  76. "type": "object"
  77. },
  78. "threshold": {
  79. "description": "Only assets bigger than this size are processed. In bytes.",
  80. "type": "number"
  81. },
  82. "minRatio": {
  83. "description": "Only assets that compress better than this ratio are processed (`minRatio = Compressed Size / Original Size`).",
  84. "type": "number"
  85. },
  86. "deleteOriginalAssets": {
  87. "description": "Whether to delete the original assets or not.",
  88. "type": "boolean"
  89. },
  90. "filename": {
  91. "description": "The target asset filename.",
  92. "anyOf": [
  93. {
  94. "type": "string"
  95. },
  96. {
  97. "instanceof": "Function"
  98. }
  99. ]
  100. },
  101. "cache": {
  102. "description": "Enable file caching. Ignored in webpack 5, for webpack 5 please use https://webpack.js.org/configuration/other-options/#cache.",
  103. "anyOf": [
  104. {
  105. "type": "boolean"
  106. },
  107. {
  108. "type": "string"
  109. }
  110. ]
  111. }
  112. },
  113. "type": "object"
  114. }