Skip to content

Commit 2ef2620

Browse files
author
Ian McNally
committed
add useful options section in readme
1 parent 08a74f1 commit 2ef2620

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

README.md

+12-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $ npm start & open http://localhost:8080
1414
## npm modules required for CSS modules
1515

1616
In this project's `package.json` file you find a lot of npm modules for this demo application. Since not all of them are required for the actual CSS modules features,
17-
we've created the following list to describe their purposes.
17+
we've created the following list to describe their purposes.
1818

1919
**Required modules**
2020

@@ -31,22 +31,30 @@ To make CSS modules work with Webpack you only have to include the modules menti
3131
. . .
3232
{
3333
test: /\.css$/,
34-
loader: 'style!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]'
34+
loader: 'style!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]'
3535
}
3636
. . .
3737
```
3838

39+
**Useful loader options**
40+
41+
The following optional css-loader query parameters (.e.g, `loader: 'css-loader?' + query`) may prove useful for using CSS modules:
42+
43+
|Query|Usage|Description|
44+
|-----|-----|-----------|
45+
|`camelCase`|`css-loader?camelCase`|Camel cases the exported class name keys. Helpful to maintain dashes in css and camel casing in javascript.|
46+
3947
**Optional modules**
4048

41-
The following modules control the *actual CSS processing*. They are *not* CSS modules specific and can be used with both "regular" CSS and CSS modules:
49+
The following modules control the *actual CSS processing*. They are *not* CSS modules specific and can be used with both "regular" CSS and CSS modules:
4250

4351
|Module|Description|
4452
|------|------------|
4553
|[postcss-loader](https://github.com/postcss/postcss-loader)|Allows execution of various CSS post processor in Webpack. Required for `autoprefixer-core` and `postcss-color-rebeccapurple`|
4654
|[autoprefixer-core](https://github.com/ai/autoprefixer-core)|Add vendor-prefixes to your css code (according to the GitHub page it is deprecated and should be replaced by [autoprefixer](https://github.com/postcss/autoprefixer)|
4755
|[postcss-color-rebeccapurple](https://github.com/postcss/postcss-color-rebeccapurple)|Another CSS post processor. Only needed to support `rebeccapurple` color in CSS|
4856
|[extract-text-webpack-plugin](https://github.com/webpack/extract-text-webpack-plugin)|Writes the CSS code processed by Webpack into an own CSS-file and not into the generated bundle JavaScript file.|
49-
57+
5058
**Unrelated modules**
5159

5260
This modules are only needed for the demo application:

0 commit comments

Comments
 (0)