cli-flags.js 4.5 KB

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