Skip to content

Commit 3362b10

Browse files
simon04joshwiens
authored andcommitted
docs(readme): practical example for images & fonts
1 parent c769ac3 commit 3362b10

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

README.md

+6-7
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ To be compatible with existing css files (if not in CSS Module mode):
8888
|**`camelCase`**|`false`|Export Classnames in CamelCase|
8989
|**`importLoaders`**|`0`|Number of loaders applied before CSS loader|
9090

91-
This webpack config can load CSS files, embed small png images as Data URLs and JPG images as files.
91+
The following webpack config can load CSS files, embed small PNG/JPG/GIF/SVG images as well as fonts as [Data URLs](https://tools.ietf.org/html/rfc2397) and copy larger files to the output directory.
9292

9393
**webpack.config.js**
9494
```js
@@ -100,12 +100,11 @@ module.exports = {
100100
use: [ 'style-loader', 'css-loader' ]
101101
},
102102
{
103-
test: /\.png$/,
104-
use: { loader: 'url-loader', options: { limit: 100000 } },
105-
},
106-
{
107-
test: /\.jpg$/,
108-
use: [ 'file-loader' ]
103+
test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
104+
loader: 'url-loader',
105+
options: {
106+
limit: 10000
107+
}
109108
}
110109
]
111110
}

0 commit comments

Comments
 (0)