Skip to content

Commit 68b20d8

Browse files
author
Michael Vurchio
committed
Import only class matching destructuring names
1 parent 4d369c1 commit 68b20d8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/parsers/importDeclaration.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ export default (processor: Processor): void => {
5757
return item.local.name;
5858
});
5959
const specifiers = `const { ${specifierNames.join(', ')} } = ${JSON.stringify(
60-
processor.importedCssModuleList
60+
Object.fromEntries(
61+
Object.entries(processor.importedCssModuleList).filter(([key]) =>
62+
specifierNames.includes(key)
63+
)
64+
)
6165
)};`;
6266
processor.magicContent.overwrite(node.start, node.end, specifiers);
6367
}

0 commit comments

Comments
 (0)