Skip to content

Commit b351acb

Browse files
committed
fixed duplicate imports
1 parent 72e90a2 commit b351acb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ const processor = (css) => {
1515
let path = doubleQuotePath || singleQuotePath;
1616
imports[path] = imports[path] || {};
1717
let tmpSymbols = symbols.split(' ')
18-
.map(s => imports[path][s] = `__tmp_${s}_${processor.getRandomStr()}`);
18+
.map(s => {
19+
if(!imports[path][s]) {
20+
imports[path][s] = `__tmp_${s}_${processor.getRandomStr()}`;
21+
}
22+
return imports[path][s];
23+
});
1924
decl.value = tmpSymbols.join(' ');
2025
}
2126
});

0 commit comments

Comments
 (0)