|
| 1 | +'use strict'; |
| 2 | + |
| 3 | +/* eslint-disable |
| 4 | + global-require, |
| 5 | + multiline-ternary, |
| 6 | + space-before-function-paren |
| 7 | +*/ |
| 8 | +const ADVANCED_GROUP = 'Advanced options:'; |
| 9 | +const DISPLAY_GROUP = 'Stats options:'; |
| 10 | +const SSL_GROUP = 'SSL options:'; |
| 11 | +const CONNECTION_GROUP = 'Connection options:'; |
| 12 | +const RESPONSE_GROUP = 'Response options:'; |
| 13 | +const BASIC_GROUP = 'Basic options:'; |
| 14 | + |
| 15 | +const options = { |
| 16 | + bonjour: { |
| 17 | + type: 'boolean', |
| 18 | + describe: 'Broadcasts the server via ZeroConf networking on start' |
| 19 | + }, |
| 20 | + lazy: { |
| 21 | + type: 'boolean', |
| 22 | + describe: 'Lazy' |
| 23 | + }, |
| 24 | + inline: { |
| 25 | + type: 'boolean', |
| 26 | + default: true, |
| 27 | + describe: 'Inline mode (set to false to disable including client scripts like livereload)' |
| 28 | + }, |
| 29 | + progress: { |
| 30 | + type: 'boolean', |
| 31 | + describe: 'Print compilation progress in percentage', |
| 32 | + group: BASIC_GROUP |
| 33 | + }, |
| 34 | + 'hot-only': { |
| 35 | + type: 'boolean', |
| 36 | + describe: 'Do not refresh page if HMR fails', |
| 37 | + group: ADVANCED_GROUP |
| 38 | + }, |
| 39 | + stdin: { |
| 40 | + type: 'boolean', |
| 41 | + describe: 'close when stdin ends' |
| 42 | + }, |
| 43 | + open: { |
| 44 | + type: 'string', |
| 45 | + describe: 'Open the default browser, or optionally specify a browser name' |
| 46 | + }, |
| 47 | + useLocalIp: { |
| 48 | + type: 'boolean', |
| 49 | + describe: 'Open default browser with local IP' |
| 50 | + }, |
| 51 | + 'open-page': { |
| 52 | + type: 'string', |
| 53 | + describe: 'Open default browser with the specified page', |
| 54 | + requiresArg: true |
| 55 | + }, |
| 56 | + color: { |
| 57 | + type: 'boolean', |
| 58 | + alias: 'colors', |
| 59 | + default: function supportsColor() { |
| 60 | + return require('supports-color'); |
| 61 | + }, |
| 62 | + group: DISPLAY_GROUP, |
| 63 | + describe: 'Enables/Disables colors on the console' |
| 64 | + }, |
| 65 | + info: { |
| 66 | + type: 'boolean', |
| 67 | + group: DISPLAY_GROUP, |
| 68 | + default: true, |
| 69 | + describe: 'Info' |
| 70 | + }, |
| 71 | + quiet: { |
| 72 | + type: 'boolean', |
| 73 | + group: DISPLAY_GROUP, |
| 74 | + describe: 'Quiet' |
| 75 | + }, |
| 76 | + 'client-log-level': { |
| 77 | + type: 'string', |
| 78 | + group: DISPLAY_GROUP, |
| 79 | + default: 'info', |
| 80 | + describe: 'Log level in the browser (info, warning, error or none)' |
| 81 | + }, |
| 82 | + https: { |
| 83 | + type: 'boolean', |
| 84 | + group: SSL_GROUP, |
| 85 | + describe: 'HTTPS' |
| 86 | + }, |
| 87 | + key: { |
| 88 | + type: 'string', |
| 89 | + describe: 'Path to a SSL key.', |
| 90 | + group: SSL_GROUP |
| 91 | + }, |
| 92 | + cert: { |
| 93 | + type: 'string', |
| 94 | + describe: 'Path to a SSL certificate.', |
| 95 | + group: SSL_GROUP |
| 96 | + }, |
| 97 | + cacert: { |
| 98 | + type: 'string', |
| 99 | + describe: 'Path to a SSL CA certificate.', |
| 100 | + group: SSL_GROUP |
| 101 | + }, |
| 102 | + pfx: { |
| 103 | + type: 'string', |
| 104 | + describe: 'Path to a SSL pfx file.', |
| 105 | + group: SSL_GROUP |
| 106 | + }, |
| 107 | + 'pfx-passphrase': { |
| 108 | + type: 'string', |
| 109 | + describe: 'Passphrase for pfx file.', |
| 110 | + group: SSL_GROUP |
| 111 | + }, |
| 112 | + 'content-base': { |
| 113 | + type: 'string', |
| 114 | + describe: 'A directory or URL to serve HTML content from.', |
| 115 | + group: RESPONSE_GROUP |
| 116 | + }, |
| 117 | + 'watch-content-base': { |
| 118 | + type: 'boolean', |
| 119 | + describe: 'Enable live-reloading of the content-base.', |
| 120 | + group: RESPONSE_GROUP |
| 121 | + }, |
| 122 | + 'history-api-fallback': { |
| 123 | + type: 'boolean', |
| 124 | + describe: 'Fallback to /index.html for Single Page Applications.', |
| 125 | + group: RESPONSE_GROUP |
| 126 | + }, |
| 127 | + compress: { |
| 128 | + type: 'boolean', |
| 129 | + describe: 'Enable gzip compression', |
| 130 | + group: RESPONSE_GROUP |
| 131 | + }, |
| 132 | + port: { |
| 133 | + describe: 'The port', |
| 134 | + group: CONNECTION_GROUP |
| 135 | + }, |
| 136 | + 'disable-host-check': { |
| 137 | + type: 'boolean', |
| 138 | + describe: 'Will not check the host', |
| 139 | + group: CONNECTION_GROUP |
| 140 | + }, |
| 141 | + socket: { |
| 142 | + type: 'String', |
| 143 | + describe: 'Socket to listen', |
| 144 | + group: CONNECTION_GROUP |
| 145 | + }, |
| 146 | + public: { |
| 147 | + type: 'string', |
| 148 | + describe: 'The public hostname/ip address of the server', |
| 149 | + group: CONNECTION_GROUP |
| 150 | + }, |
| 151 | + host: { |
| 152 | + type: 'string', |
| 153 | + default: 'localhost', |
| 154 | + describe: 'The hostname/ip address the server will bind to', |
| 155 | + group: CONNECTION_GROUP |
| 156 | + }, |
| 157 | + 'allowed-hosts': { |
| 158 | + type: 'string', |
| 159 | + describe: 'A comma-delimited string of hosts that are allowed to access the dev server', |
| 160 | + group: CONNECTION_GROUP |
| 161 | + } |
| 162 | +}; |
| 163 | + |
| 164 | +module.exports = options; |
0 commit comments