Skip to content

Commit

Permalink
Allow opening the browser even when verbose mode is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
thgh committed Aug 27, 2020
1 parent b67f94e commit f647446
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,17 @@ function serve (options = { contentBase: '' }) {
server = createServer(requestListener).listen(options.port, options.host)
}

let running = options.verbose === false
let first = true

return {
name: 'serve',
generateBundle () {
if (!running) {
running = true
if (first) {
first = false

// Log which url to visit
const url = (options.https ? 'https' : 'http') + '://' + (options.host || 'localhost') + ':' + options.port
if (options.verbose) {
if (options.verbose !== false) {
options.contentBase.forEach(base => {
console.log(green(url) + ' -> ' + resolve(base))
})
Expand Down

0 comments on commit f647446

Please sign in to comment.