mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-11 16:17:25 +02:00
Don't open a site in a new tab if it's already open (#698)
* Don't open a site in a new tab if it's already open * Remove opn from dependencies
This commit is contained in:
parent
454e3d359f
commit
407636a4d9
4 changed files with 2650 additions and 1945 deletions
|
@ -24,7 +24,7 @@ const tcpPortUsed = require('tcp-port-used');
|
|||
// initial check that required files are present
|
||||
const chalk = require('chalk');
|
||||
const fs = require('fs');
|
||||
const opn = require('opn');
|
||||
const openBrowser = require('react-dev-utils/openBrowser');
|
||||
const CWD = process.cwd();
|
||||
|
||||
if (!fs.existsSync(CWD + '/siteConfig.js')) {
|
||||
|
@ -65,7 +65,7 @@ function checkPort() {
|
|||
server(port);
|
||||
const host = `http://localhost:${port}`;
|
||||
console.log('Docusaurus server started on port %d', port);
|
||||
opn(host);
|
||||
openBrowser(host);
|
||||
}
|
||||
})
|
||||
.catch(function(ex) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue