Skip to content

Commit

Permalink
fix(docz-core): app running port message
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronauck committed Jul 1, 2018
1 parent 6ce9e84 commit 1b94114
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/docz-core/src/bundlers/webpack/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export const createConfig = (babelrc: BabelRC) => (
{
compilationSuccessInfo: {
messages: [
`You application is running at ${protocol}://${hostname}:${port}`,
`Your application is running at ${protocol}://${hostname}:${port}`,
],
},
},
Expand Down
11 changes: 6 additions & 5 deletions packages/docz-core/src/commands/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@ process.env.NODE_ENV = process.env.NODE_ENV || 'development'

export const dev = async (args: Config) => {
const config = loadConfig(args)
const bundler = webpack(config, 'development')
const port = await detectPort(config.port)
const bundler = webpack({ ...config, port }, 'development')
const entries = new Entries(config)
const map = await entries.get()
const server = await bundler.createServer(bundler.getConfig())
const app = await server.start()

app.on('listening', async ({ server }) => {
const port = await detectPort(config.websocketPort)
app.on('listening', async ({ server, options }) => {
const websocketPort = await detectPort(config.websocketPort)
const run = Plugin.runPluginsMethod(config.plugins)
const newConfig = { ...config, websocketPort: port }
const newConfig = { ...config, websocketPort }
const dataServer = new DataServer({ server, config: newConfig })

try {
Expand All @@ -35,7 +36,7 @@ export const dev = async (args: Config) => {
await Entries.writeApp(newConfig, true)
await Entries.writeImports(map)

logger.info(`Setup entries socket on port ${port}`)
logger.info(`Setup entries socket on port ${websocketPort}`)
await dataServer.processEntries(entries)
await dataServer.processThemeConfig()
await run('onServerListening', server)
Expand Down

0 comments on commit 1b94114

Please sign in to comment.