Skip to content

Commit bdc092e

Browse files
feat: namedExport
1 parent 16a48fe commit bdc092e

File tree

1 file changed

+1
-51
lines changed

1 file changed

+1
-51
lines changed

README.md

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ module.exports = {
118118
| **[`importLoaders`](#importloaders)** | `{Number}` | `0` | Enables/Disables or setups number of loaders applied before CSS loader |
119119
| **[`onlyLocals`](#onlylocals)** | `{Boolean}` | `false` | Export only locals |
120120
| **[`esModule`](#esmodule)** | `{Boolean}` | `false` | Use ES modules syntax |
121-
| **[`namedExport`](#namedExport)** | `{Boolean}` | `false` | Use ES modules named export |
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
namedExport: true,
@@ -1089,56 +1089,6 @@ module.exports = {
10891089
};
10901090
```
10911091

1092-
### `namedExport`
1093-
1094-
Type: `Boolean`
1095-
Default: `false`
1096-
1097-
Enable/disable ES modules named export for css classes.
1098-
Names of exported classes are converted to camelCase.
1099-
1100-
**styles.css**
1101-
1102-
```css
1103-
.foo-baz {
1104-
color: red;
1105-
}
1106-
.bar {
1107-
color: blue;
1108-
}
1109-
```
1110-
1111-
**index.js**
1112-
1113-
```js
1114-
import { fooBaz, bar } from './styles.css';
1115-
1116-
console.log(fooBaz, bar);
1117-
```
1118-
1119-
You can enable a ES module named export using:
1120-
1121-
**webpack.config.js**
1122-
1123-
```js
1124-
module.exports = {
1125-
module: {
1126-
rules: [
1127-
{
1128-
test: /\.css$/i,
1129-
loader: 'css-loader',
1130-
options: {
1131-
esModule: true,
1132-
modules: {
1133-
namedExport: true,
1134-
},
1135-
},
1136-
},
1137-
],
1138-
},
1139-
};
1140-
```
1141-
11421092
## Examples
11431093

11441094
### Assets

0 commit comments

Comments
 (0)