You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+61
Original file line number
Diff line number
Diff line change
@@ -11,12 +11,73 @@ $ npm install
11
11
$ npm start & open http://localhost:8080
12
12
```
13
13
14
+
## npm modules required for CSS modules
15
+
16
+
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.
18
+
19
+
**Required modules**
20
+
21
+
The following modules are the only ones really needed to get started with CSS modules:
22
+
23
+
|Module|Description|
24
+
|------|------------|
25
+
|[Webpack]|Webpack (obviously...)|
26
+
|[webpack-dev-server]|(Optional) Supports hotloading of changed files etc while developing||
27
+
|[style-loader] and [css-loader]|`style-loader` and `css-loader` process your CSS files. `css-loader` is the loader that actual makes [CSS modules] work|
28
+
29
+
To make CSS modules work with Webpack you only have to include the modules mentioned above and add the following loader to your `webpack.config.js` file:
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:
42
+
43
+
|Module|Description|
44
+
|------|------------|
45
+
|[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`|
46
+
|[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)|
47
+
|[postcss-color-rebeccapurple](https://github.com/postcss/postcss-color-rebeccapurple)|Another CSS post processor. Only needed to support `rebeccapurple` color in CSS|
48
+
|[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
+
50
+
**Unrelated modules**
51
+
52
+
This modules are only needed for the demo application:
53
+
54
+
|Module|Description |
55
+
|------|------------|
56
+
|[babel]|ESx-to-ES5 compiler. Mostly needed for React code|
57
+
|[ejs]|JavaScript templating language|
58
+
|[react-to-html-webpack-plugin]|Webpack plug-in that renders React components|
59
+
|[node-libs-browser]|Node libraries for in-browser use|
60
+
|[gh-pages]|Publishes file to a `gh-pages` branches for GitHub pages|
61
+
|[url-loader]|Webpack file handling, e.g. for images|
62
+
|[file-loader]|Webpack file handling, e.g. for images|
63
+
|[raw-loader]|It’s used to load raw css files (as utf8) into the demo so it can be rendered into `<code>`|
0 commit comments