gulp-webserver icon indicating copy to clipboard operation
gulp-webserver copied to clipboard

Automatically open browser?

Open jlister76 opened this issue 9 years ago • 4 comments

Great plug-in. I am able to run my gulp command and start the localhost and everything works. The only part of the config that I do not fully understand is how to automatically open the browser.

The documentation says "open:" accepts a boolean / string. I believe the string would be the path. However, I am not sure which path it is referencing. Any assistance with this is much appreciated.

Here is my task: //Webserver gulp.task('webserver', function() { gulp.src('app/builds/development/') .pipe(webserver({ livereload: true, directoylisting: false, open: true })) });

jlister76 avatar Oct 21 '14 18:10 jlister76

  • open: false -> doesn't open,
  • open: true -> opens in browser,
  • open: String ->
    • if string begins with 'http', the opened url will be the string as-is.
    • else, open will be appended after the port.

dasilvacontin avatar Nov 02 '14 13:11 dasilvacontin

Can I choose the browser instead of the default one? Eg. I use the Safari as the default browser for daily web browsing, but I use Chrome mainly for development.

So I hope it can open the Chrome in my case.

chaoyangnz avatar Oct 18 '15 04:10 chaoyangnz

@richdyang +1

NMichas avatar Dec 09 '15 13:12 NMichas

choose would be nice

juri33 avatar Nov 30 '16 21:11 juri33