Skip to content

Commit

Permalink
fix(docz-core): create app files before start server
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronauck committed Nov 15, 2018
1 parent 04abef7 commit 43bc3fd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/docz-core/src/commands/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ export const dev = async (args: Config) => {

const bundlerConfig = await bundler.getConfig(env)
const server = await bundler.createServer(bundlerConfig)

try {
await Entries.writeApp(newConfig, true)
} catch (err) {
logger.fatal('Failed to build your files:', err)
process.exit(1)
}

const instance = await server.start()
const dataServer = new DataServer(
instance.app.server,
Expand All @@ -40,7 +48,6 @@ export const dev = async (args: Config) => {
])

try {
await Entries.writeApp(newConfig, true)
await dataServer.init()
await dataServer.listen()
} catch (err) {
Expand Down

0 comments on commit 43bc3fd

Please sign in to comment.