@@ -14,33 +14,25 @@ const plugin = postcss.plugin("postcss-cssnext", (options) => {
14
14
15
15
const features = options . features
16
16
17
- // propagate browsers option to autoprefixer
18
- if ( features . autoprefixer !== false ) {
19
- features . autoprefixer = {
20
- browsers : (
21
- features . autoprefixer && features . autoprefixer . browsers
22
- ? features . autoprefixer . browsers
23
- : options . browsers
24
- ) ,
25
- ...( features . autoprefixer || { } ) ,
26
- }
17
+ // propagate browsers option to plugins that supports it
18
+ "autoprefixer pixrem" . split ( / \s / ) . forEach ( name => {
19
+ const feature = features [ name ]
27
20
28
- // autoprefixer doesn't like an "undefined" value. Related to coffee ?
29
- if ( features . autoprefixer . browsers === undefined ) {
30
- delete features . autoprefixer . browsers
21
+ if ( feature !== false ) {
22
+ features [ name ] = {
23
+ browsers : (
24
+ feature && feature . browsers
25
+ ? feature . browsers
26
+ : options . browsers
27
+ ) ,
28
+ ...( feature || { } ) ,
29
+ }
31
30
}
32
- }
31
+ } )
33
32
34
- // propagate browsers option to pixrem
35
- if ( features . pixrem !== false ) {
36
- features . pixrem = {
37
- browsers : (
38
- features . pixrem && features . pixrem . browsers
39
- ? features . pixrem . browsers
40
- : options . browsers
41
- ) ,
42
- ...( features . pixrem || { } ) ,
43
- }
33
+ // autoprefixer doesn't like an "undefined" value. Related to coffee ?
34
+ if ( features . autoprefixer && features . autoprefixer . browsers === undefined ) {
35
+ delete features . autoprefixer . browsers
44
36
}
45
37
46
38
const processor = postcss ( )
0 commit comments