Skip to content

Commit

Permalink
Don't start server if target isn't browser (#1204)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasper De Moor authored and devongovett committed Apr 27, 2018
1 parent 31190cf commit 9064b3b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,10 @@ async function bundle(main, command) {

const bundler = new Bundler(main, command);

if (command.name() === 'serve') {
command.target = command.target || 'browser';
if (command.name() === 'serve' && command.target === 'browser') {
const server = await bundler.serve(command.port || 1234, command.https);
if (command.open) {
if (server && command.open) {
await require('./utils/openInBrowser')(
`${command.https ? 'https' : 'http'}://localhost:${
server.address().port
Expand Down

0 comments on commit 9064b3b

Please sign in to comment.