fix(ui): open when server is ready

This commit is contained in:
Guillaume Chau
2018-04-27 01:35:41 +02:00
parent 802499e532
commit 602be0388e
4 changed files with 10 additions and 10 deletions

View File

@@ -1,3 +1,5 @@
const { openBrowser } = require('@vue/cli-shared-utils')
module.exports = api => {
api.registerCommand('ui', args => {
api.setMode('production')
@@ -18,6 +20,8 @@ module.exports = api => {
}
}
server(opts)
server(opts, () => {
openBrowser(`http://localhost:${process.env.VUE_APP_GRAPHQL_PORT}`)
})
})
}

View File

@@ -56,7 +56,7 @@
"lint-staged": "^6.0.0",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.1",
"vue-cli-plugin-apollo": "^0.7.7",
"vue-cli-plugin-apollo": "^0.7.8",
"vue-template-compiler": "^2.5.16"
},
"browserslist": [

View File

@@ -1,4 +1,4 @@
const { log, error, openBrowser } = require('@vue/cli-shared-utils')
const { log, error } = require('@vue/cli-shared-utils')
const portfinder = require('portfinder')
const execa = require('execa')
@@ -23,10 +23,6 @@ async function ui (options = {}, context = process.cwd()) {
cwd: context,
stdio: ['inherit', 'inherit', 'inherit']
})
setTimeout(() => {
openBrowser(`http://localhost:${port}`)
}, 1000)
}
module.exports = (...args) => {

View File

@@ -10964,9 +10964,9 @@ vue-class-component@^6.0.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/vue-class-component/-/vue-class-component-6.2.0.tgz#7adb1daa9a868c75f30f97f33f4f1b94aee62089"
vue-cli-plugin-apollo@^0.7.7:
version "0.7.7"
resolved "https://registry.yarnpkg.com/vue-cli-plugin-apollo/-/vue-cli-plugin-apollo-0.7.7.tgz#47e7e30e02f8eca20c1cc5dd0395fb2c3848afc8"
vue-cli-plugin-apollo@^0.7.8:
version "0.7.8"
resolved "https://registry.yarnpkg.com/vue-cli-plugin-apollo/-/vue-cli-plugin-apollo-0.7.8.tgz#087898aaba4015e2791149a8d01e230ddc919beb"
dependencies:
apollo-engine "^1.1.0"
apollo-server-express "^1.3.2"