Skip to content
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.

Allow empty plugin options. #14

Merged
merged 1 commit into from
Sep 16, 2015

Conversation

izaakschroeder
Copy link
Contributor

This allows for a conditional extra parameter to not throw an error when using babel programatically (i.e. not via .babelrc). For example:

extra: {
  'react-transform': env !== 'production' ? [{
    target: 'react-transform-webpack-hmr',
    imports: [ 'react' ],
    locals: [ 'module' ]
  }] : [ ] // This would otherwise balk.
}

Arguably one could simply check if there are no extra values for the plugin and simply not load it.

This allows for a conditional `extra` parameter to not throw an error when using babel programatically (i.e. not via `.babelrc`). For example:

```javascript
extra: {
  'react-transform': env !== 'production' ? [{
    target: 'react-transform-webpack-hmr',
    imports: [ 'react' ],
    locals: [ 'module' ]
  }] : [ ] // This would otherwise balk.
}
```

Arguably one could simply check if there are no `extra` values for the plugin and simply not load it.
@izaakschroeder
Copy link
Contributor Author

/ping @gaearon

gaearon added a commit that referenced this pull request Sep 16, 2015
@gaearon gaearon merged commit 2d507af into gaearon:master Sep 16, 2015
@gaearon
Copy link
Owner

gaearon commented Sep 16, 2015

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants