Skip to content

Commit

Permalink
feat: add exportGlobals option
Browse files Browse the repository at this point in the history
  • Loading branch information
David Liu committed Mar 20, 2020
1 parent bc63911 commit 723f3d9
Show file tree
Hide file tree
Showing 10 changed files with 658 additions and 563 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@ module.exports = {
localIdentName: '[path][name]__[local]--[hash:base64:5]',
context: path.resolve(__dirname, 'src'),
hashPrefix: 'my-custom-hash',
exportGlobals: true,
},
},
},
Expand Down Expand Up @@ -886,6 +887,33 @@ module.exports = {
};
```

### `exportGlobals`

Type: `Boolean`
Default: `false`

Allow `css-loader` to export names from global class or id, so you can use that as local name.

**webpack.config.js**

```js
module.exports = {
module: {
rules: [
{
test: /\.css$/i,
loader: 'css-loader',
options: {
modules: {
exportGlobals: true,
},
},
},
],
},
};
```

## Examples

### Assets
Expand Down

0 comments on commit 723f3d9

Please sign in to comment.