()
| 37 | } |
| 38 | |
| 39 | async setupBroccoliWatcher() { |
| 40 | let options = this.buildOptions(); |
| 41 | |
| 42 | logger.info('initialize %o', options); |
| 43 | this.watcher = this.watcher || (await this.constructBroccoliWatcher(options)); |
| 44 | |
| 45 | this.setupBroccoliChangeEvent(); |
| 46 | this.watcher.on('buildStart', this._setupBroccoliWatcherBuild.bind(this)); |
| 47 | this.watcher.on('buildSuccess', this.didChange.bind(this)); |
| 48 | |
| 49 | // build errors arriving via watcher |
| 50 | this.watcher.on('buildFailure', this.didError.bind(this)); |
| 51 | // watcher specific errors |
| 52 | this.watcher.on('error', this.didError.bind(this)); |
| 53 | |
| 54 | this.serveURL = serveURL; |
| 55 | } |
| 56 | |
| 57 | async constructBroccoliWatcher(options) { |
| 58 | const { Watcher } = require('broccoli'); |
no test coverage detected