File tree 1 file changed +29
-1
lines changed
1 file changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -980,11 +980,13 @@ module.exports = {
980
980
981
981
##### ` namedExport `
982
982
983
- Type: ` Boolean `
983
+ Type: ` Boolean|Function `
984
984
Default: ` false `
985
985
986
986
Enables/disables ES modules named export for locals.
987
987
988
+ ###### ` Boolean `
989
+
988
990
> ⚠ Names of locals are converted to camelcase, i.e. the ` exportLocalsConvention ` option has ` camelCaseOnly ` value by default.
989
991
990
992
> ⚠ It is not allowed to use JavaScript reserved words in css class names.
@@ -1031,6 +1033,32 @@ module.exports = {
1031
1033
};
1032
1034
```
1033
1035
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
+
1034
1062
##### ` exportGlobals `
1035
1063
1036
1064
Type: ` Boolean `
You can’t perform that action at this time.
0 commit comments