Skip to content

Commit 29576ff

Browse files
committed
added example config to README fixes #1
1 parent fd2a7f6 commit 29576ff

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

README.md

+19-1
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,30 @@ var css = require("css!./file.css");
77
// => returns css code from file.css, resolves imports and url(...)
88
```
99

10+
css code will be minimized if specified by the module system.
11+
1012
`@import` will be required with this css loader.
1113

1214
`url(...)` will be required. You should define useful loaders by config.
1315

1416
Good loaders to require these files is the [file-loader](https://github.com/webpack/file-loader) and the [url-loader](https://github.com/webpack/url-loader).
1517

18+
### Example config
19+
20+
This webpack config can load css files, embed small png images as Data Urls and jpg images as files.
21+
22+
``` javascript
23+
module.exports = {
24+
module: {
25+
loaders: {
26+
{ test: /\.css/, loader: "style-loader!css-loader" },
27+
{ test: /\.png/, loader: "url-loader?limit=100000&minetype=image/png" },
28+
{ test: /\.jpg/, loader: "file-loader" }
29+
}
30+
}
31+
};
32+
```
33+
1634
## License
1735

18-
MIT (http://www.opensource.org/licenses/mit-license.php)
36+
MIT (http://www.opensource.org/licenses/mit-license.php)

0 commit comments

Comments
 (0)