File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -99,9 +99,15 @@ export default function transformCssModules({ types: t }) {
99
99
// find options for this plugin
100
100
// we have to use this hack because plugin.key does not have to be 'css-modules-transform'
101
101
// so we will identify it by comparing manipulateOptions
102
- thisPluginOptions = options . plugins . filter (
103
- ( [ plugin ] ) => plugin . manipulateOptions === pluginApi . manipulateOptions
104
- ) [ 0 ] [ 1 ] ;
102
+ if ( Array . isArray ( options . plugins [ 0 ] ) ) { // babel 6
103
+ thisPluginOptions = options . plugins . filter (
104
+ ( [ plugin ] ) => plugin . manipulateOptions === pluginApi . manipulateOptions
105
+ ) [ 0 ] [ 1 ] ;
106
+ } else { // babel 7
107
+ thisPluginOptions = options . plugins . filter (
108
+ ( plugin ) => plugin . manipulateOptions === pluginApi . manipulateOptions
109
+ ) [ 0 ] . options ;
110
+ }
105
111
106
112
const currentConfig = { ...defaultOptions , ...thisPluginOptions } ;
107
113
// this is not a css-require-ook config
You can’t perform that action at this time.
0 commit comments