Skip to content

Commit c038fe2

Browse files
committed
disable opening the page in browser when in development mode
1 parent fea8ab0 commit c038fe2

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

bin/serve.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,13 @@ export async function serve(serveDirectory, key) {
5757
}
5858
}
5959
console.log(`hyperparam server running on http://localhost:${port}`)
60-
if (!key) openUrl(`http://localhost:${port}`)
61-
else {
62-
key = encodeURIComponent(key)
63-
openUrl(`http://localhost:${port}/files?key=${key}`)
60+
const isDev = process.env.NODE_ENV === 'development'
61+
if (!isDev) {
62+
if (!key) openUrl(`http://localhost:${port}`)
63+
else {
64+
key = encodeURIComponent(key)
65+
openUrl(`http://localhost:${port}/files?key=${key}`)
66+
}
6467
}
6568
}
6669

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
"url": "run-p -l watch:ts watch:vite watch:url",
4444
"watch:ts": "tsc --watch",
4545
"watch:vite": "vite build --watch",
46-
"watch:serve": "nodemon bin/cli.js",
47-
"watch:url": "nodemon bin/cli.js https://hyperparam.blob.core.windows.net/hyperparam/starcoderdata-js-00000-of-00065.parquet"
46+
"watch:serve": "NODE_ENV=development nodemon bin/cli.js",
47+
"watch:url": "NODE_ENV=development nodemon bin/cli.js https://hyperparam.blob.core.windows.net/hyperparam/starcoderdata-js-00000-of-00065.parquet"
4848
},
4949
"dependencies": {
5050
"hightable": "0.12.1",

0 commit comments

Comments
 (0)