Skip to content

Commit be5675c

Browse files
committed
fix: dont overwrite staticServer config
1 parent 5e74a57 commit be5675c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/browser.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ export default class Browser extends Hookable {
4444
}
4545

4646
if (key === 'staticserver') {
47-
this.config.staticServer = true
47+
if (!this.config.staticServer) {
48+
this.config.staticServer = true
49+
}
4850
continue
4951
}
5052

src/utils/commands/static-server.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ export default class StaticServer {
3535

3636
app.use(StaticServer.serveStatic(config.folder))
3737

38-
let { host, port } = config
39-
host = process.env.HOST || host || 'localhost'
40-
port = process.env.PORT || port || 3000
38+
const host = process.env.HOST || config.host || 'localhost'
39+
const port = process.env.PORT || config.port || 3000
4140

4241
StaticServer.server = app.listen(port, host)
4342

0 commit comments

Comments
 (0)