Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Commit

Permalink
fix app starting before the bundle has been written (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangruber authored Mar 23, 2017
1 parent acf2a4d commit e8a0e56
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ app.on('ready', () => {
if (env.NODE_ENV !== 'production') {
const browserify = require('./lib/browserify')
const b = browserify({ watch: true })
b.once('bundle', onReady)
b.once('written', onReady)
} else {
onReady()
}
Expand Down
1 change: 1 addition & 0 deletions lib/browserify.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ module.exports = opts => {
b.bundle().pipe(concat(js => {
fs.writeFile(`${__dirname}/../bundle.js`, js, err => {
if (err) throw err
b.emit('written')
process.stderr.write('ok!\n')
})
}))
Expand Down

0 comments on commit e8a0e56

Please sign in to comment.