Skip to content

Commit

Permalink
adding bundle-error event doc
Browse files Browse the repository at this point in the history
  • Loading branch information
selfcontained committed May 11, 2014
1 parent 7f266cb commit a75ffc3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ app.use(bundler.middleware(/^\/js\/(.+)\.js$/));
+ `pre-bundle` - [bundle, moduleName, modulePath] - prior to bundle call
+ `pre-response` - [error, response, moduleName, source] - prior to calling `send()` on the response
+ `new-source` - [moduleName, source] - whenever the source updates due to files changing.
+ `bundle-error` - [error] - fired whenever an error is intercepted from a bundle call

```javascript
bundler = DevBundler({ root: '/my/modules' });
Expand All @@ -110,6 +111,11 @@ bundler.on('pre-bundle', function(bundle, module, modulePath) {
// add specific files
bundle.add('some/random-file.js');
});

// add logging to show bundle errors in the console
bundler.on('bundle-error', function(err) {
console.log('Bundle Error: ', err.message);
});
```

## Why did I build this?
Expand Down

0 comments on commit a75ffc3

Please sign in to comment.