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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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