1.自动打开浏览器
只需要在config/index.js里找到autoOpenBrowser将其设为true即可
2.获取本地ip
在config/index.js 顶部添加
const os = require('os')
let localhost = ''
try {
const network = os.networkInterfaces()
localhost = network[Object.keys(network)[0]][1].address
}
再找到host将其改为host:localhost即可
host: localhost, // can be overwritten by process.env.HOST
port: 8080, //