@@ -27,13 +27,7 @@ const webpack = require('webpack');
27
27
28
28
const options = require ( './options' ) ;
29
29
30
- const {
31
- colors,
32
- status,
33
- version,
34
- bonjour,
35
- defaultTo
36
- } = require ( './utils' ) ;
30
+ const { colors, status, version, bonjour, defaultTo } = require ( './utils' ) ;
37
31
38
32
const Server = require ( '../lib/Server' ) ;
39
33
@@ -43,7 +37,7 @@ const createLogger = require('../lib/utils/createLogger');
43
37
44
38
let server ;
45
39
46
- const signals = [ 'SIGINT' , 'SIGTERM' ] ;
40
+ const signals = [ 'SIGINT' , 'SIGTERM' ] ;
47
41
48
42
signals . forEach ( ( signal ) => {
49
43
process . on ( signal , ( ) => {
70
64
require . resolve ( 'webpack-cli' ) ;
71
65
} catch ( err ) {
72
66
console . error ( 'The CLI moved into a separate package: webpack-cli' ) ;
73
- console . error ( 'Please install \'webpack-cli\' in addition to webpack itself to use the CLI' ) ;
67
+ console . error (
68
+ "Please install 'webpack-cli' in addition to webpack itself to use the CLI"
69
+ ) ;
74
70
console . error ( '-> When using npm: npm i -D webpack-cli' ) ;
75
71
console . error ( '-> When using yarn: yarn add -D webpack-cli' ) ;
76
72
@@ -97,7 +93,7 @@ const config = require('webpack-cli/bin/convert-argv')(yargs, argv, {
97
93
// we should use portfinder.
98
94
const DEFAULT_PORT = 8080 ;
99
95
100
- function processOptions ( config ) {
96
+ function processOptions ( config ) {
101
97
// processOptions {Promise}
102
98
if ( typeof config . then === 'function' ) {
103
99
config . then ( processOptions ) . catch ( ( err ) => {
@@ -109,9 +105,7 @@ function processOptions (config) {
109
105
return ;
110
106
}
111
107
112
- const firstWpOpt = Array . isArray ( config )
113
- ? config [ 0 ]
114
- : config ;
108
+ const firstWpOpt = Array . isArray ( config ) ? config [ 0 ] : config ;
115
109
116
110
const options = config . devServer || firstWpOpt . devServer || { } ;
117
111
@@ -141,7 +135,8 @@ function processOptions (config) {
141
135
142
136
if ( ! options . publicPath ) {
143
137
// eslint-disable-next-line
144
- options . publicPath = firstWpOpt . output && firstWpOpt . output . publicPath || '' ;
138
+ options . publicPath =
139
+ ( firstWpOpt . output && firstWpOpt . output . publicPath ) || '' ;
145
140
146
141
if (
147
142
! / ^ ( h t t p s ? : ) ? \/ \/ / . test ( options . publicPath ) &&
@@ -214,11 +209,7 @@ function processOptions (config) {
214
209
typeof options . stats === 'object' &&
215
210
typeof options . stats . colors === 'undefined'
216
211
) {
217
- options . stats = Object . assign (
218
- { } ,
219
- options . stats ,
220
- { colors : argv . color }
221
- ) ;
212
+ options . stats = Object . assign ( { } , options . stats , { colors : argv . color } ) ;
222
213
}
223
214
224
215
if ( argv . lazy ) {
@@ -277,9 +268,10 @@ function processOptions (config) {
277
268
// that wouldn't throw errors. E.g. both argv.port and options.port
278
269
// were specified, but since argv.port is 8080, options.port will be
279
270
// tried first instead.
280
- options . port = argv . port === DEFAULT_PORT
281
- ? defaultTo ( options . port , argv . port )
282
- : defaultTo ( argv . port , options . port ) ;
271
+ options . port =
272
+ argv . port === DEFAULT_PORT
273
+ ? defaultTo ( options . port , argv . port )
274
+ : defaultTo ( argv . port , options . port ) ;
283
275
284
276
if ( options . port != null ) {
285
277
startDevServer ( config , options ) ;
@@ -325,7 +317,10 @@ function startDevServer(config, options) {
325
317
} ) . apply ( compiler ) ;
326
318
}
327
319
328
- const suffix = ( options . inline !== false || options . lazy === true ? '/' : '/webpack-dev-server/' ) ;
320
+ const suffix =
321
+ options . inline !== false || options . lazy === true
322
+ ? '/'
323
+ : '/webpack-dev-server/' ;
329
324
330
325
try {
331
326
server = new Server ( compiler , options , log ) ;
0 commit comments