Skip to content

Commit

Permalink
Init bankai after mkdirp (#489)
Browse files Browse the repository at this point in the history
This is a πŸ› 

When I was trying to add the faviconTag to the document I found this bug. I created a `faviconNode`, called `createEdge()` inside it, then the graph's change event was emited, then it [emits the compiler's change event](https://github.com/choojs/bankai/blob/master/index.js#L56) immediately, but at this moment, [compiler's change event](https://github.com/choojs/bankai/blob/master/lib/cmd-build.js#L47) has not yet been listened.

<!-- Provide a general summary of the changes in the title above -->

## Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->
- [x] tests pass
- [ ] tests and/or benchmarks are included
- [ ] documentation is changed or added

## Context
No

## Semver Changes
minor
  • Loading branch information
zhouhanseng authored and goto-bus-stop committed May 25, 2018
1 parent f894c98 commit 1b5c959
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/cmd-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,18 @@ function build (entry, outdir, opts) {
watch: false,
base: opts.base
}
var compiler = bankai(entry, bankaiOpts)
var log = compiler.log

if (!outdir) {
outdir = path.join(compiler.dirname, 'dist')
var dirname = path.extname(entry) === '' ? entry : utils.dirname(entry)
outdir = path.join(dirname, 'dist')
}

mkdirp(outdir, function (err) {
if (err) return console.error(err)

var compiler = bankai(entry, bankaiOpts)
var log = compiler.log

log.info('Compiling & compressing files\n')
created(compiler.dirname, outdir + '/')

Expand Down

0 comments on commit 1b5c959

Please # to comment.