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

Commit

Permalink
Merge pull request #14 from izaakschroeder/allow-empty-options
Browse files Browse the repository at this point in the history
Allow empty plugin options.
  • Loading branch information
gaearon committed Sep 16, 2015
2 parents bcea895 + aa24007 commit 2d507af
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,11 @@ export default function ({ Plugin, types: t }) {
return;
}
const pluginOptions = file.opts.extra['react-transform'];
if (!Array.isArray(pluginOptions) || pluginOptions.length === 0) {
if (!Array.isArray(pluginOptions)) {
throw new Error(
'babel-plugin-react-transform requires that you specify ' +
'extras["react-transform"] in .babelrc ' +
'or in your Babel Node API call options, and that it is an array ' +
'with more than zero elements.'
'or in your Babel Node API call options, and that it is an array.'
);
}
return pluginOptions;
Expand Down

0 comments on commit 2d507af

Please sign in to comment.