cli-flags.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. 'use strict';
  2. const ADVANCED_GROUP = 'Advanced options:';
  3. const DISPLAY_GROUP = 'Stats options:';
  4. const SSL_GROUP = 'SSL options:';
  5. const CONNECTION_GROUP = 'Connection options:';
  6. const RESPONSE_GROUP = 'Response options:';
  7. const BASIC_GROUP = 'Basic options:';
  8. module.exports = {
  9. devServer: [
  10. {
  11. name: 'bonjour',
  12. type: Boolean,
  13. describe: 'Broadcasts the server via ZeroConf networking on start',
  14. },
  15. {
  16. name: 'lazy',
  17. type: Boolean,
  18. describe: 'Lazy',
  19. },
  20. {
  21. name: 'liveReload',
  22. type: Boolean,
  23. defaultValue: true,
  24. describe: 'Enables/Disables live reloading on changing files',
  25. },
  26. {
  27. name: 'serveIndex',
  28. type: Boolean,
  29. describe: 'Enables/Disables serveIndex middleware',
  30. defaultValue: true,
  31. },
  32. {
  33. name: 'inline',
  34. type: Boolean,
  35. defaultValue: true,
  36. describe:
  37. 'Inline mode (set to false to disable including client scripts like livereload)',
  38. },
  39. {
  40. name: 'profile',
  41. type: Boolean,
  42. describe: 'Print compilation profile data for progress steps',
  43. },
  44. {
  45. name: 'progress',
  46. type: Boolean,
  47. describe: 'Print compilation progress in percentage',
  48. group: BASIC_GROUP,
  49. },
  50. {
  51. name: 'hot-only',
  52. type: Boolean,
  53. describe: 'Do not refresh page if HMR fails',
  54. group: ADVANCED_GROUP,
  55. },
  56. {
  57. name: 'stdin',
  58. type: Boolean,
  59. describe: 'close when stdin ends',
  60. },
  61. {
  62. name: 'open',
  63. type: [String, Boolean],
  64. describe:
  65. 'Open the default browser, or optionally specify a browser name',
  66. },
  67. {
  68. name: 'useLocalIp',
  69. type: Boolean,
  70. describe: 'Open default browser with local IP',
  71. },
  72. {
  73. name: 'open-page',
  74. type: String,
  75. describe: 'Open default browser with the specified page',
  76. },
  77. {
  78. name: 'client-log-level',
  79. type: String,
  80. group: DISPLAY_GROUP,
  81. defaultValue: 'info',
  82. describe:
  83. 'Log level in the browser (trace, debug, info, warn, error or silent)',
  84. },
  85. {
  86. name: 'https',
  87. type: Boolean,
  88. group: SSL_GROUP,
  89. describe: 'HTTPS',
  90. },
  91. {
  92. name: 'http2',
  93. type: Boolean,
  94. group: SSL_GROUP,
  95. describe: 'HTTP/2, must be used with HTTPS',
  96. },
  97. {
  98. name: 'key',
  99. type: String,
  100. describe: 'Path to a SSL key.',
  101. group: SSL_GROUP,
  102. },
  103. {
  104. name: 'cert',
  105. type: String,
  106. describe: 'Path to a SSL certificate.',
  107. group: SSL_GROUP,
  108. },
  109. {
  110. name: 'cacert',
  111. type: String,
  112. describe: 'Path to a SSL CA certificate.',
  113. group: SSL_GROUP,
  114. },
  115. {
  116. name: 'pfx',
  117. type: String,
  118. describe: 'Path to a SSL pfx file.',
  119. group: SSL_GROUP,
  120. },
  121. {
  122. name: 'pfx-passphrase',
  123. type: String,
  124. describe: 'Passphrase for pfx file.',
  125. group: SSL_GROUP,
  126. },
  127. {
  128. name: 'content-base',
  129. type: String,
  130. describe: 'A directory or URL to serve HTML content from.',
  131. group: RESPONSE_GROUP,
  132. },
  133. {
  134. name: 'watch-content-base',
  135. type: Boolean,
  136. describe: 'Enable live-reloading of the content-base.',
  137. group: RESPONSE_GROUP,
  138. },
  139. {
  140. name: 'history-api-fallback',
  141. type: Boolean,
  142. describe: 'Fallback to /index.html for Single Page Applications.',
  143. group: RESPONSE_GROUP,
  144. },
  145. {
  146. name: 'compress',
  147. type: Boolean,
  148. describe: 'Enable gzip compression',
  149. group: RESPONSE_GROUP,
  150. },
  151. // findPort is currently not set up
  152. {
  153. name: 'port',
  154. type: Number,
  155. describe: 'The port',
  156. group: CONNECTION_GROUP,
  157. },
  158. {
  159. name: 'disable-host-check',
  160. type: Boolean,
  161. describe: 'Will not check the host',
  162. group: CONNECTION_GROUP,
  163. },
  164. {
  165. name: 'socket',
  166. type: String,
  167. describe: 'Socket to listen',
  168. group: CONNECTION_GROUP,
  169. },
  170. {
  171. name: 'public',
  172. type: String,
  173. describe: 'The public hostname/ip address of the server',
  174. group: CONNECTION_GROUP,
  175. },
  176. {
  177. name: 'host',
  178. type: String,
  179. describe: 'The hostname/ip address the server will bind to',
  180. group: CONNECTION_GROUP,
  181. },
  182. // use command-line-args "multiple" option, allowing the usage: --allowed-hosts host1 host2 host3
  183. // instead of the old, comma-separated syntax: --allowed-hosts host1,host2,host3
  184. {
  185. name: 'allowed-hosts',
  186. type: String,
  187. describe:
  188. 'A list of hosts that are allowed to access the dev server, separated by spaces',
  189. group: CONNECTION_GROUP,
  190. multiple: true,
  191. },
  192. ],
  193. };