Skip to content

Commit b9eb902

Browse files
authored
set group for loaders (webpack#5444)
* set group for loaders * fix * use uppercase
1 parent 7c9907f commit b9eb902

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

src/utilities/fetch-package-readmes.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ const pathMap = {
1919
plugins: path.resolve(__dirname, '../content/plugins'),
2020
};
2121

22+
const loaderGroup = {
23+
'css-loader': 'CSS',
24+
'less-loader': 'CSS',
25+
'postcss-loader': 'CSS',
26+
'sass-loader': 'CSS',
27+
'style-loader': 'CSS',
28+
'stylus-loader': 'CSS',
29+
};
30+
2231
async function main() {
2332
for (const type of types) {
2433
const outputDir = pathMap[type];
@@ -56,13 +65,17 @@ async function main() {
5665
repo: htmlUrl,
5766
});
5867
} else {
59-
// TODO we need other categories for loaders
60-
headmatter = yamlHeadmatter({
68+
let basic = {
6169
title: title,
6270
source: url,
6371
edit: editUrl,
6472
repo: htmlUrl,
65-
});
73+
};
74+
75+
if (loaderGroup[packageName]) {
76+
basic.group = loaderGroup[packageName];
77+
}
78+
headmatter = yamlHeadmatter(basic);
6679
}
6780

6881
const response = await fetch(url);

0 commit comments

Comments
 (0)