Skip to content

Commit 8a0f1dc

Browse files
authored
docs(configuration): add css generator exportsConvention and localIdentName (#7165)
1 parent 72c6288 commit 8a0f1dc

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

src/content/configuration/module.mdx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ contributors:
2222
- chenxsan
2323
- snitin315
2424
- vabushkevich
25+
- ahabhgk
2526
---
2627

2728
These options determine how the [different types of modules](/concepts/modules) within a project will be treated.
@@ -148,9 +149,28 @@ module.exports = {
148149
// Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
149150
// type: boolean, available since webpack 5.90.0
150151
exportsOnly: true,
152+
153+
// Customize how css export names are exported to javascript modules, such as keeping them as is, transforming them to camel case, etc.
154+
// type: 'as-is' | 'camel-case' | 'camel-case-only' | 'dashes' | 'dashes-only' | ((name: string) => string)
155+
// available since webpack 5.90.4
156+
exportsConvention: 'camel-case-only',
151157
},
152158
'css/auto': {
153-
// ditto
159+
// Generator options for css/auto modules
160+
161+
// Avoid generating and loading a stylesheet and only embed exports from css into output javascript files.
162+
// type: boolean, available since webpack 5.90.0
163+
exportsOnly: true,
164+
165+
// Customize how css export names are exported to javascript modules, such as keeping them as is, transforming them to camel case, etc.
166+
// type: 'as-is' | 'camel-case' | 'camel-case-only' | 'dashes' | 'dashes-only' | ((name: string) => string)
167+
// available since webpack 5.90.4
168+
exportsConvention: 'camel-case-only',
169+
170+
// Customize the format of the local class names generated for css modules.
171+
// type: string, besides the substitutions at File-level and Module-level in https://webpack.js.org/configuration/output/#template-strings, also include [uniqueName] and [local].
172+
// available since webpack 5.90.4
173+
localIdentName: '[uniqueName]-[id]-[local]',
154174
},
155175
'css/global': {
156176
// ditto

0 commit comments

Comments
 (0)