Skip to content

Commit

Permalink
feat(dev): document how to disable browser auto launch (#4106)
Browse files Browse the repository at this point in the history
* docs(de): document how to avoid browser to auto start

* fix: remove wrong docs

Co-authored-by: Alberto De Agostini <alberto.deagostini@adevinta.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 21, 2022
1 parent d0e93d6 commit b15f228
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/commands/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ netlify dev
netlify dev
netlify dev -d public
netlify dev -c "hugo server -w" --targetPort 1313
BROWSER=none netlify dev # disable browser auto opening
```

---
Expand Down
6 changes: 6 additions & 0 deletions docs/netlify-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ EXAMPLES
$ netlify dev -c "hugo server -w" --targetPort 1313
```
The command will automatically open your preferred browser to serve the application. You can customize this behaviour by using the `BROWSER` environment variable:
```bash
$ BROWSER=none netlify dev # this will disable the auto opening of the browser
```
## Live Share
To share your ongoing dev session with a coworker, just run Netlify Dev with a `--live` flag:
Expand Down
7 changes: 6 additions & 1 deletion src/commands/dev/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,12 @@ const createDevCommand = (program) => {
'specify the path to a local GeoIP location database in MMDB format',
).hideHelp(),
)
.addExamples(['netlify dev', 'netlify dev -d public', 'netlify dev -c "hugo server -w" --targetPort 1313'])
.addExamples([
'netlify dev',
'netlify dev -d public',
'netlify dev -c "hugo server -w" --targetPort 1313',
'BROWSER=none netlify dev # disable browser auto opening',
])
.action(dev)
}
module.exports = { createDevCommand }

1 comment on commit b15f228

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

Package size: 357 MB

Please sign in to comment.