-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
523a6ec
commit 21687c3
Showing
12 changed files
with
88 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict'; | ||
|
||
const colors = { | ||
info(useColor, msg) { | ||
if (useColor) { | ||
// Make text blue and bold, so it *pops* | ||
return `\u001b[1m\u001b[34m${msg}\u001b[39m\u001b[22m`; | ||
} | ||
|
||
return msg; | ||
}, | ||
error(useColor, msg) { | ||
if (useColor) { | ||
// Make text red and bold, so it *pops* | ||
return `\u001b[1m\u001b[31m${msg}\u001b[39m\u001b[22m`; | ||
} | ||
|
||
return msg; | ||
}, | ||
}; | ||
|
||
module.exports = colors; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
function defaultTo(value, def) { | ||
return value == null ? def : value; | ||
} | ||
|
||
module.exports = defaultTo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
'use strict'; | ||
|
||
/* eslint-disable global-require */ | ||
|
||
function getVersions() { | ||
return ( | ||
`webpack-dev-server ${require('../../package.json').version}\n` + | ||
`webpack ${require('webpack/package.json').version}` | ||
); | ||
} | ||
|
||
module.exports = getVersions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
|
||
function runBonjour(options) { | ||
// eslint-disable-next-line global-require | ||
const bonjour = require('bonjour')(); | ||
|
||
bonjour.publish({ | ||
name: 'Webpack Dev Server', | ||
port: options.port, | ||
type: 'http', | ||
subtypes: ['webpack'], | ||
}); | ||
|
||
process.on('exit', () => { | ||
bonjour.unpublishAll(() => { | ||
bonjour.destroy(); | ||
}); | ||
}); | ||
} | ||
|
||
module.exports = runBonjour; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters