options.json 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. {
  2. "title": "Imports Loader options",
  3. "definitions": {
  4. "ImportItemString": {
  5. "type": "string",
  6. "minLength": 1,
  7. "description": "Allows to use a string to describe an import.",
  8. "link": "https://webpack.js.org/loaders/imports-loader/#string"
  9. },
  10. "ImportItemObject": {
  11. "type": "object",
  12. "additionalProperties": false,
  13. "description": "Allows to use an object to describe an import.",
  14. "link": "https://webpack.js.org/loaders/imports-loader/#object",
  15. "properties": {
  16. "syntax": {
  17. "enum": [
  18. "default",
  19. "named",
  20. "namespace",
  21. "side-effects",
  22. "single",
  23. "multiple",
  24. "pure"
  25. ]
  26. },
  27. "moduleName": {
  28. "type": "string",
  29. "minLength": 1
  30. },
  31. "name": {
  32. "type": "string",
  33. "minLength": 1
  34. },
  35. "alias": {
  36. "type": "string",
  37. "minLength": 1
  38. }
  39. },
  40. "required": ["moduleName"]
  41. },
  42. "ImportItem": {
  43. "anyOf": [
  44. {
  45. "$ref": "#/definitions/ImportItemString"
  46. },
  47. {
  48. "$ref": "#/definitions/ImportItemObject"
  49. }
  50. ]
  51. }
  52. },
  53. "type": "object",
  54. "description": "Options for imports-loader",
  55. "properties": {
  56. "type": {
  57. "enum": ["module", "commonjs"],
  58. "description": "Format of generated exports.",
  59. "link": "https://github.com/webpack-contrib/imports-loader#type"
  60. },
  61. "imports": {
  62. "anyOf": [
  63. {
  64. "$ref": "#/definitions/ImportItemString"
  65. },
  66. {
  67. "$ref": "#/definitions/ImportItem"
  68. },
  69. {
  70. "type": "array",
  71. "minItems": 1,
  72. "items": {
  73. "$ref": "#/definitions/ImportItem"
  74. }
  75. }
  76. ]
  77. },
  78. "wrapper": {
  79. "anyOf": [
  80. {
  81. "type": "boolean"
  82. },
  83. {
  84. "type": "string",
  85. "minLength": 1
  86. },
  87. {
  88. "type": "object",
  89. "additionalProperties": false,
  90. "properties": {
  91. "thisArg": {
  92. "type": "string",
  93. "minLength": 1
  94. },
  95. "args": {
  96. "anyOf": [
  97. {
  98. "type": "array",
  99. "minItems": 1,
  100. "items": {
  101. "type": "string",
  102. "minLength": 1
  103. }
  104. },
  105. {
  106. "type": "object",
  107. "additionalProperties": true
  108. }
  109. ]
  110. }
  111. },
  112. "required": ["thisArg"]
  113. }
  114. ],
  115. "description": "Closes the module code in a function with a given 'thisArg' and 'args'",
  116. "link": "https://webpack.js.org/loaders/imports-loader/#wrapper"
  117. },
  118. "additionalCode": {
  119. "type": "string",
  120. "minLength": 1,
  121. "description": "Adds custom code as a preamble before the module's code.",
  122. "link": "https://webpack.js.org/loaders/imports-loader/#additionalcode"
  123. }
  124. },
  125. "anyOf": [
  126. { "required": ["imports"] },
  127. { "required": ["wrapper"] },
  128. { "required": ["additionalCode"] }
  129. ],
  130. "additionalProperties": false
  131. }