options.json 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. {
  2. "definitions": {
  3. "Rule": {
  4. "description": "Filtering rule as regex or string.",
  5. "anyOf": [
  6. {
  7. "instanceof": "RegExp",
  8. "tsType": "RegExp"
  9. },
  10. {
  11. "type": "string",
  12. "minLength": 1
  13. }
  14. ]
  15. },
  16. "Rules": {
  17. "description": "Filtering rules.",
  18. "anyOf": [
  19. {
  20. "type": "array",
  21. "items": {
  22. "description": "A rule condition.",
  23. "oneOf": [
  24. {
  25. "$ref": "#/definitions/Rule"
  26. }
  27. ]
  28. }
  29. },
  30. {
  31. "$ref": "#/definitions/Rule"
  32. }
  33. ]
  34. }
  35. },
  36. "title": "TerserPluginOptions",
  37. "type": "object",
  38. "additionalProperties": false,
  39. "properties": {
  40. "test": {
  41. "description": "Include all modules that pass test assertion.",
  42. "link": "https://github.com/webpack-contrib/terser-webpack-plugin#test",
  43. "oneOf": [
  44. {
  45. "$ref": "#/definitions/Rules"
  46. }
  47. ]
  48. },
  49. "include": {
  50. "description": "Include all modules matching any of these conditions.",
  51. "link": "https://github.com/webpack-contrib/terser-webpack-plugin#include",
  52. "oneOf": [
  53. {
  54. "$ref": "#/definitions/Rules"
  55. }
  56. ]
  57. },
  58. "exclude": {
  59. "description": "Exclude all modules matching any of these conditions.",
  60. "link": "https://github.com/webpack-contrib/terser-webpack-plugin#exclude",
  61. "oneOf": [
  62. {
  63. "$ref": "#/definitions/Rules"
  64. }
  65. ]
  66. },
  67. "terserOptions": {
  68. "description": "Options for `terser` (by default) or custom `minify` function.",
  69. "link": "https://github.com/webpack-contrib/terser-webpack-plugin#terseroptions",
  70. "additionalProperties": true,
  71. "type": "object"
  72. },
  73. "extractComments": {
  74. "description": "Whether comments shall be extracted to a separate file.",
  75. "link": "https://github.com/webpack-contrib/terser-webpack-plugin#extractcomments",
  76. "anyOf": [
  77. {
  78. "type": "boolean"
  79. },
  80. {
  81. "type": "string",
  82. "minLength": 1
  83. },
  84. {
  85. "instanceof": "RegExp"
  86. },
  87. {
  88. "instanceof": "Function"
  89. },
  90. {
  91. "additionalProperties": false,
  92. "properties": {
  93. "condition": {
  94. "anyOf": [
  95. {
  96. "type": "boolean"
  97. },
  98. {
  99. "type": "string",
  100. "minLength": 1
  101. },
  102. {
  103. "instanceof": "RegExp"
  104. },
  105. {
  106. "instanceof": "Function"
  107. }
  108. ],
  109. "description": "Condition what comments you need extract.",
  110. "link": "https://github.com/webpack-contrib/terser-webpack-plugin#condition"
  111. },
  112. "filename": {
  113. "anyOf": [
  114. {
  115. "type": "string",
  116. "minLength": 1
  117. },
  118. {
  119. "instanceof": "Function"
  120. }
  121. ],
  122. "description": "The file where the extracted comments will be stored. Default is to append the suffix .LICENSE.txt to the original filename.",
  123. "link": "https://github.com/webpack-contrib/terser-webpack-plugin#filename"
  124. },
  125. "banner": {
  126. "anyOf": [
  127. {
  128. "type": "boolean"
  129. },
  130. {
  131. "type": "string",
  132. "minLength": 1
  133. },
  134. {
  135. "instanceof": "Function"
  136. }
  137. ],
  138. "description": "The banner text that points to the extracted file and will be added on top of the original file",
  139. "link": "https://github.com/webpack-contrib/terser-webpack-plugin#banner"
  140. }
  141. },
  142. "type": "object"
  143. }
  144. ]
  145. },
  146. "parallel": {
  147. "description": "Use multi-process parallel running to improve the build speed.",
  148. "link": "https://github.com/webpack-contrib/terser-webpack-plugin#parallel",
  149. "anyOf": [
  150. {
  151. "type": "boolean"
  152. },
  153. {
  154. "type": "integer"
  155. }
  156. ]
  157. },
  158. "minify": {
  159. "description": "Allows you to override default minify function.",
  160. "link": "https://github.com/webpack-contrib/terser-webpack-plugin#number",
  161. "instanceof": "Function"
  162. }
  163. }
  164. }