Skip to content

Commit 3b0bf60

Browse files
docs: updated
1 parent 3928488 commit 3b0bf60

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

README.md

+29-1
Original file line numberDiff line numberDiff line change
@@ -980,11 +980,13 @@ module.exports = {
980980

981981
##### `namedExport`
982982

983-
Type: `Boolean`
983+
Type: `Boolean|Function`
984984
Default: `false`
985985

986986
Enables/disables ES modules named export for locals.
987987

988+
###### `Boolean`
989+
988990
> ⚠ Names of locals are converted to camelcase, i.e. the `exportLocalsConvention` option has `camelCaseOnly` value by default.
989991
990992
> ⚠ It is not allowed to use JavaScript reserved words in css class names.
@@ -1031,6 +1033,32 @@ module.exports = {
10311033
};
10321034
```
10331035

1036+
###### `Function`
1037+
1038+
If `namedExport` function, `exportLocalsConvention` option is ignored;
1039+
1040+
**webpack.config.js**
1041+
1042+
```js
1043+
module.exports = {
1044+
module: {
1045+
rules: [
1046+
{
1047+
test: /\.css$/i,
1048+
loader: "css-loader",
1049+
options: {
1050+
modules: {
1051+
namedExport: function (name) {
1052+
return name.replace(/-/g, "_");
1053+
},
1054+
},
1055+
},
1056+
},
1057+
],
1058+
},
1059+
};
1060+
```
1061+
10341062
##### `exportGlobals`
10351063

10361064
Type: `Boolean`

0 commit comments

Comments
 (0)