Uh oh!
There was an error while loading. Please reload this page.
feat(serve): implement open default browser option for ng serve - #2489
feat(serve): implement open default browser option for ng serve#2489dzonatan wants to merge 2 commits into
Conversation
| reject(err.details); | ||
| } else { | ||
| if(commandOptions.open) { | ||
| opn(`http://${commandOptions.host}:${commandOptions.port}/`); |
There was a problem hiding this comment.
importurlfrom'url';
...
const{ open, host, port }=commandOptions;if(open){opn(url.format({protocol: 'http',hostname: host, port }));}There was a problem hiding this comment.
Are there any pros of that url formatter?
I was trying to make it same as webpack dev server binary do.
There was a problem hiding this comment.
It's built in and escapes funky stuff like ipv6 addresses properly
bdede2b to
b38438fCompare| name: 'open', | ||
| description: 'Opens the url in default browser', | ||
| type: Boolean, | ||
| default: false |
There was a problem hiding this comment.
Can you add the o alias?
aliases: ['o']
filipesilva
commented
Oct 9, 2016
This is nice, thanks! I added the request for an alias, I think it would help. People could then do |
b38438f to
51ffdf0Compare| } else { | ||
| const { open, host, port } = commandOptions; | ||
| if (open) { | ||
| opn(url.format({ protocol: 'http', hostname: host, port: port.toString() })); |
Splaktar
commented
Oct 11, 2016
Thank you! |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Sometimes it's really handy to have auto browser opening when serving app.
This PR implements that by
--openoption forng servecommand.Closes#1081