File tree Expand file tree Collapse file tree 9 files changed +62
-10
lines changed
import-multiple-references Expand file tree Collapse file tree 9 files changed +62
-10
lines changed Original file line number Diff line number Diff line change @@ -26,11 +26,11 @@ const processor = (css) => {
26
26
} ) ;
27
27
28
28
// If we've found any imports, insert :import rules
29
- Object . keys ( imports ) . forEach ( path => {
29
+ Object . keys ( imports ) . reverse ( ) . forEach ( path => {
30
30
let pathImports = imports [ path ] ;
31
31
css . prepend ( postcss . rule ( {
32
32
selector : `:import("${ path } ")` ,
33
- before : "\n" ,
33
+ after : "\n" ,
34
34
nodes : Object . keys ( pathImports ) . map ( importedSymbol => postcss . decl ( {
35
35
prop : importedSymbol ,
36
36
value : pathImports [ importedSymbol ] ,
Original file line number Diff line number Diff line change 1
-
2
- : import ("path/other-lib.css" ) {
3
- otherLibImport : __tmp_otherLibImport_rand3;
4
- }
5
1
: import ("path/library.css" ) {
6
2
importName : __tmp_importName_rand0;
7
3
secondImport : __tmp_secondImport_rand1;
8
4
thirdImport : __tmp_thirdImport_rand2;
9
5
}
6
+ : import ("path/other-lib.css" ) {
7
+ otherLibImport : __tmp_otherLibImport_rand3;
8
+ }
10
9
: local (.exportName ) {
11
10
extends : __tmp_importName_rand0 __tmp_secondImport_rand1;
12
11
other : rule;
Original file line number Diff line number Diff line change
1
+ : import ("path/library.css" ) {
2
+ importName : __tmp_importName_rand0;
3
+ importName2 : __tmp_importName2_rand1;
4
+ }
5
+
6
+ @media screen {
7
+ : local (.exportName ) {
8
+ extends : __tmp_importName_rand0;
9
+ extends : __tmp_importName2_rand1;
10
+ other : rule2;
11
+ }
12
+ }
13
+
14
+ : local (.exportName ) {
15
+ extends : __tmp_importName_rand0;
16
+ other : rule;
17
+ }
Original file line number Diff line number Diff line change
1
+ @media screen {
2
+ : local (.exportName ) {
3
+ extends : importName from "path/library.css" ;
4
+ extends : importName2 from "path/library.css" ;
5
+ other : rule2;
6
+ }
7
+ }
8
+
9
+ : local (.exportName ) {
10
+ extends : importName from "path/library.css" ;
11
+ other : rule;
12
+ }
Original file line number Diff line number Diff line change 1
-
2
1
: import ("path/library.css" ) {
3
2
importName : __tmp_importName_rand0;
4
- secondImport : __tmp_secondImport_rand1; }
3
+ secondImport : __tmp_secondImport_rand1;
4
+ }
5
5
: local (.exportName ) { extends : __tmp_importName_rand0 __tmp_secondImport_rand1; other : rule; }
Original file line number Diff line number Diff line change
1
+ : import ("path/library.css" ) {
2
+ importName : __tmp_importName_rand0;
3
+ secondImport : __tmp_secondImport_rand1;
4
+ importName2 : __tmp_importName2_rand3;
5
+ }
6
+ : import ("path/library2.css" ) {
7
+ importName : __tmp_importName_rand2;
8
+ }
9
+ : local (.exportName ) {
10
+ extends : __tmp_importName_rand0 __tmp_secondImport_rand1;
11
+ extends : __tmp_importName_rand2;
12
+ extends : __tmp_importName2_rand3;
13
+ }
14
+ : local (.exportName2 ) {
15
+ extends : __tmp_secondImport_rand1;
16
+ extends : __tmp_secondImport_rand1;
17
+ }
Original file line number Diff line number Diff line change
1
+ : local (.exportName ) {
2
+ extends : importName secondImport from 'path/library.css' ;
3
+ extends : importName from 'path/library2.css' ;
4
+ extends : importName2 from 'path/library.css' ;
5
+ }
6
+ : local (.exportName2 ) {
7
+ extends : secondImport from 'path/library.css' ;
8
+ extends : secondImport from 'path/library.css' ;
9
+ }
Original file line number Diff line number Diff line change 1
-
2
1
: import ("path/library.css" ) {
3
2
importName : __tmp_importName_rand0;
4
3
}
Original file line number Diff line number Diff line change 1
-
2
1
: import ("path/library.css" ) {
3
2
importName : __tmp_importName_rand0;
4
3
}
You can’t perform that action at this time.
0 commit comments