Skip to content

Commit

Permalink
Added an option to toggle debug mode in babel-preset-env by using deb…
Browse files Browse the repository at this point in the history
…ug variable
  • Loading branch information
IvanKalinin authored and ljharb committed Jun 24, 2017
1 parent 35f56a7 commit 67d156e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,13 @@ If you wish, you can also inherit our default list of browsers and extend them u
}]]
}
```

You may override our default debug option by providing your own `debug` key.

```json
{
"presets": [["airbnb", {
"debug": true
}]]
}
```
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ module.exports = function buildAirbnbPreset(context, options) {
var transpileTargets = (options && options.targets) ||
buildTargets(options || {});

var debug = (options && typeof options.debug === 'boolean') ? !!options.debug : false;

return {
presets: [
require('babel-preset-env').default(null, {
debug: true,
debug: debug,
exclude: [
'transform-async-to-generator',
'transform-es2015-template-literals',
Expand Down

0 comments on commit 67d156e

Please sign in to comment.