@@ -109,16 +109,15 @@ module.exports = {
109109
110110## Options
111111
112- | Name | Type | Default | Description |
113- | :-----------------------------------------: | :-------------------------: | :----------------: | :--------------------------------------------------------------------- |
114- | ** [ ` url ` ] ( #url ) ** | ` {Boolean\|Function} ` | ` true ` | Enables/Disables ` url ` /` image-set ` functions handling |
115- | ** [ ` import ` ] ( #import ) ** | ` {Boolean\|Function} ` | ` true ` | Enables/Disables ` @import ` at-rules handling |
116- | ** [ ` modules ` ] ( #modules ) ** | ` {Boolean\|String\|Object} ` | ` false ` | Enables/Disables CSS Modules and their configuration |
117- | ** [ ` sourceMap ` ] ( #sourcemap ) ** | ` {Boolean} ` | ` compiler.devtool ` | Enables/Disables generation of source maps |
118- | ** [ ` importLoaders ` ] ( #importloaders ) ** | ` {Number} ` | ` 0 ` | Enables/Disables or setups number of loaders applied before CSS loader |
119- | ** [ ` localsConvention ` ] ( #localsconvention ) ** | ` {String} ` | ` 'asIs' ` | Style of exported classnames |
120- | ** [ ` onlyLocals ` ] ( #onlylocals ) ** | ` {Boolean} ` | ` false ` | Export only locals |
121- | ** [ ` esModule ` ] ( #esmodule ) ** | ` {Boolean} ` | ` false ` | Use ES modules syntax |
112+ | Name | Type | Default | Description |
113+ | :-----------------------------------: | :-------------------------: | :----------------: | :--------------------------------------------------------------------- |
114+ | ** [ ` url ` ] ( #url ) ** | ` {Boolean\|Function} ` | ` true ` | Enables/Disables ` url ` /` image-set ` functions handling |
115+ | ** [ ` import ` ] ( #import ) ** | ` {Boolean\|Function} ` | ` true ` | Enables/Disables ` @import ` at-rules handling |
116+ | ** [ ` modules ` ] ( #modules ) ** | ` {Boolean\|String\|Object} ` | ` false ` | Enables/Disables CSS Modules and their configuration |
117+ | ** [ ` sourceMap ` ] ( #sourcemap ) ** | ` {Boolean} ` | ` compiler.devtool ` | Enables/Disables generation of source maps |
118+ | ** [ ` importLoaders ` ] ( #importloaders ) ** | ` {Number} ` | ` 0 ` | Enables/Disables or setups number of loaders applied before CSS loader |
119+ | ** [ ` onlyLocals ` ] ( #onlylocals ) ** | ` {Boolean} ` | ` false ` | Export only locals |
120+ | ** [ ` esModule ` ] ( #esmodule ) ** | ` {Boolean} ` | ` false ` | Use ES modules syntax |
122121
123122### ` url `
124123
@@ -532,6 +531,7 @@ module.exports = {
532531 mode: ' local' ,
533532 exportGlobals: true ,
534533 localIdentName: ' [path][name]__[local]--[hash:base64:5]' ,
534+ localsConvention: ' camelCase' ,
535535 context: path .resolve (__dirname , ' src' ),
536536 hashPrefix: ' my-custom-hash' ,
537537 },
@@ -756,6 +756,55 @@ module.exports = {
756756};
757757```
758758
759+ ### ` localsConvention `
760+
761+ Type: ` String `
762+ Default: ` 'asIs' `
763+
764+ Style of exported classnames.
765+
766+ By default, the exported JSON keys mirror the class names (i.e ` asIs ` value).
767+
768+ | Name | Type | Description |
769+ | :-------------------: | :--------: | :----------------------------------------------------------------------------------------------- |
770+ | ** ` 'asIs' ` ** | ` {String} ` | Class names will be exported as is. |
771+ | ** ` 'camelCase' ` ** | ` {String} ` | Class names will be camelized, the original class name will not to be removed from the locals |
772+ | ** ` 'camelCaseOnly' ` ** | ` {String} ` | Class names will be camelized, the original class name will be removed from the locals |
773+ | ** ` 'dashes' ` ** | ` {String} ` | Only dashes in class names will be camelized |
774+ | ** ` 'dashesOnly' ` ** | ` {String} ` | Dashes in class names will be camelized, the original class name will be removed from the locals |
775+
776+ ** file.css**
777+
778+ ``` css
779+ .class-name {
780+ }
781+ ```
782+
783+ ** file.js**
784+
785+ ``` js
786+ import { className } from ' file.css' ;
787+ ```
788+
789+ ** webpack.config.js**
790+
791+ ``` js
792+ module .exports = {
793+ module: {
794+ rules: [
795+ {
796+ test: / \. css$ / i ,
797+ loader: ' css-loader' ,
798+ options: {
799+ mode: ' local' ,
800+ localsConvention: ' camelCase' ,
801+ },
802+ },
803+ ],
804+ },
805+ };
806+ ```
807+
759808##### ` context `
760809
761810Type: ` String `
@@ -930,54 +979,6 @@ module.exports = {
930979
931980This may change in the future when the module system (i. e. webpack) supports loader matching by origin.
932981
933- ### ` localsConvention `
934-
935- Type: ` String `
936- Default: ` 'asIs' `
937-
938- Style of exported classnames.
939-
940- By default, the exported JSON keys mirror the class names (i.e ` asIs ` value).
941-
942- | Name | Type | Description |
943- | :-------------------: | :--------: | :----------------------------------------------------------------------------------------------- |
944- | ** ` 'asIs' ` ** | ` {String} ` | Class names will be exported as is. |
945- | ** ` 'camelCase' ` ** | ` {String} ` | Class names will be camelized, the original class name will not to be removed from the locals |
946- | ** ` 'camelCaseOnly' ` ** | ` {String} ` | Class names will be camelized, the original class name will be removed from the locals |
947- | ** ` 'dashes' ` ** | ` {String} ` | Only dashes in class names will be camelized |
948- | ** ` 'dashesOnly' ` ** | ` {String} ` | Dashes in class names will be camelized, the original class name will be removed from the locals |
949-
950- ** file.css**
951-
952- ``` css
953- .class-name {
954- }
955- ```
956-
957- ** file.js**
958-
959- ``` js
960- import { className } from ' file.css' ;
961- ```
962-
963- ** webpack.config.js**
964-
965- ``` js
966- module .exports = {
967- module: {
968- rules: [
969- {
970- test: / \. css$ / i ,
971- loader: ' css-loader' ,
972- options: {
973- localsConvention: ' camelCase' ,
974- },
975- },
976- ],
977- },
978- };
979- ```
980-
981982### ` onlyLocals `
982983
983984Type: ` Boolean `
0 commit comments