Skip to content

Commit 1ab50df

Browse files
committed
Fix plugins as array
1 parent 52e7a21 commit 1ab50df

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,19 @@ module.exports = function (source, map) {
2727
var plugins;
2828
if ( typeof options === 'undefined' ) {
2929
plugins = [];
30-
} else if ( !Array.isArray(options) ) {
30+
} else if ( Array.isArray(options) ) {
31+
plugins = options;
32+
} else {
3133
plugins = options.plugins || options.defaults;
3234
opts.stringifier = options.stringifier;
3335
opts.parser = options.parser;
3436
opts.syntax = options.syntax;
3537
}
3638
if ( params.pack ) {
3739
plugins = options[params.pack];
40+
if ( !plugins ) {
41+
throw new Error('PostCSS plugin pack is not defined in options');
42+
}
3843
}
3944

4045
if ( params.syntax ) {

0 commit comments

Comments
 (0)