File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -3,8 +3,7 @@ var selectorParser = require('postcss-selector-parser')
3
3
var loaderUtils = require ( 'loader-utils' )
4
4
var assign = require ( 'object-assign' )
5
5
6
- var currentId
7
- var addId = postcss . plugin ( 'add-id' , function ( ) {
6
+ var addId = postcss . plugin ( 'add-id' , function ( opts ) {
8
7
return function ( root ) {
9
8
root . each ( function rewriteSelector ( node ) {
10
9
if ( ! node . selector ) {
@@ -21,7 +20,7 @@ var addId = postcss.plugin('add-id', function () {
21
20
if ( n . type !== 'pseudo' ) node = n
22
21
} )
23
22
selector . insertAfter ( node , selectorParser . attribute ( {
24
- attribute : currentId
23
+ attribute : opts . id
25
24
} ) )
26
25
} )
27
26
} ) . process ( node . selector ) . result
@@ -46,7 +45,7 @@ module.exports = function (css, map) {
46
45
47
46
// scoped css
48
47
if ( query . scoped ) {
49
- plugins . push ( addId )
48
+ plugins . push ( addId ( { id : query . id } ) )
50
49
}
51
50
52
51
// autoprefixer
@@ -82,7 +81,6 @@ module.exports = function (css, map) {
82
81
}
83
82
}
84
83
85
- currentId = query . id
86
84
postcss ( plugins )
87
85
. process ( css , opts )
88
86
. then ( function ( result ) {
You can’t perform that action at this time.
0 commit comments