Skip to content

Commit 44563e5

Browse files
author
Alexander Grigoriev
committed
Update peerDependencies to support version 3 of css-loader
Closes #13
1 parent 690480c commit 44563e5

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# dts-css-modules-loader
2-
Replacement for the [typings-for-css-modules-loader](https://github.com/Jimdo/typings-for-css-modules-loader). This loader does not make any changes in content of styles, just creates `*.d.ts` file during the work. It is assumed that the content will be preprocessed first by [css-loader](https://github.com/webpack-contrib/css-loader).
2+
Replacement for the [typings-for-css-modules-loader](https://github.com/Jimdo/typings-for-css-modules-loader). This loader does not make any changes in content of styles, just creates `*.d.ts` file during the work. It is assumed that the content will be preprocessed first by [css-loader](https://github.com/webpack-contrib/css-loader). Currently supported versions 2 and 3 of the `css-loader`.
33

44
## Installation
55
```bash
@@ -23,16 +23,18 @@ yarn add -D dts-css-modules-loader
2323
{
2424
loader: 'css-loader',
2525
options: {
26-
modules: true, // this option must be enabled
27-
camelCase: 'only',
28-
localIdentName: '[local]',
29-
exportOnlyLocals: true
26+
modules: { // this option must be enabled
27+
localIdentName: '[local]'
28+
}
29+
localsConvention: 'camelCaseOnly',
30+
onlyLocals: true
3031
}
3132
},
3233
'sass-loader'
3334
]
3435
}
3536
```
37+
`css-loader` options presented for the third version.
3638

3739
## Options
3840
### `namedExport`

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ function getClasses(content) {
4949
/** @type {string[]} */
5050
let classes = [];
5151

52-
// when `exportOnlyLocals` is on
52+
// when `onlyLocals` is on
5353
let from = content.indexOf('module.exports = {');
54-
// when `exportOnlyLocals` is off
54+
// when `onlyLocals` is off
5555
from = ~from ? from : content.indexOf('exports.locals = {');
5656

5757
if (~from) {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "dts-css-modules-loader",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "webpack loader to generate typings for css modules",
55
"dependencies": {
66
"loader-utils": "^1.2.0"
77
},
88
"peerDependencies": {
9-
"css-loader": "^2.0.2"
9+
"css-loader": "^2.0.0 || ^3.0.0"
1010
},
1111
"keywords": [
1212
"css-modules",

0 commit comments

Comments
 (0)