Skip to content

Commit 1c94157

Browse files
author
Xu Xinhang
committed
style: for comment gajus#2
1 parent fb7a829 commit 1c94157

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/getClassName.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ export default (styleNameValue: string, styleModuleImportMap: StyleModuleImportM
120120
return getClassNameFromMultipleImports(styleName, styleModuleImportMap, handleMissingStyleName);
121121
}
122122

123+
// There is only one imported CSS module file.
123124
const styleModuleMap: StyleModuleMapType = styleModuleImportMap[styleModuleImportMapKeys[0]];
124125

125126
if (!styleModuleMap[styleName]) {

src/index.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ export default ({
129129
return filename.match(new RegExp(exclude));
130130
};
131131

132+
// decide whether the import statement should be processed as CSS module
132133
const notForPlugin = (path: *, stats: *) => {
133134
stats.opts.filetypes = stats.opts.filetypes || {};
134135

@@ -144,13 +145,9 @@ export default ({
144145
}
145146

146147
const filetypeKeys = Object.keys(stats.opts.filetypes);
147-
148148
filetypeKeys.push('.css');
149-
if (!findMatchedFiletype(filename, filetypeKeys)) {
150-
return true;
151-
}
152149

153-
return false;
150+
return !findMatchedFiletype(filename, filetypeKeys);
154151
};
155152

156153
return {

0 commit comments

Comments
 (0)