Skip to content

Commit a8a1208

Browse files
author
David Liu
committed
feat: add exportGlobals option
1 parent fe0e6c9 commit a8a1208

10 files changed

+658
-563
lines changed

README.md

+28
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ module.exports = {
531531
localIdentName: '[path][name]__[local]--[hash:base64:5]',
532532
context: path.resolve(__dirname, 'src'),
533533
hashPrefix: 'my-custom-hash',
534+
exportGlobals: true,
534535
},
535536
},
536537
},
@@ -886,6 +887,33 @@ module.exports = {
886887
};
887888
```
888889

890+
### `exportGlobals`
891+
892+
Type: `Boolean`
893+
Default: `false`
894+
895+
Allow `css-loader` to export names from global class or id, so you can use that as local name.
896+
897+
**webpack.config.js**
898+
899+
```js
900+
module.exports = {
901+
module: {
902+
rules: [
903+
{
904+
test: /\.css$/i,
905+
loader: 'css-loader',
906+
options: {
907+
modules: {
908+
exportGlobals: true,
909+
},
910+
},
911+
},
912+
],
913+
},
914+
};
915+
```
916+
889917
## Examples
890918

891919
### Assets

0 commit comments

Comments
 (0)