Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ With this configuration:
```js
{
module: {
loaders: [
{ test: /\.jpg$/, loader: "file-loader" },
{ test: /\.png$/, loader: "url-loader?mimetype=image/png" }
rules: [
{ test: /\.jpg$/, use: [ "file-loader" ] },
{ test: /\.png$/, use: [ "url-loader?mimetype=image/png" ] }
]
},
output: {
Expand Down Expand Up @@ -86,16 +86,18 @@ minimized by running `webpack --optimize-minimize`
data-src=data:image/png;base64,...>'
```

or specify the `minimize` query in your `webpack.conf.js`
or specify the `minimize` property in the rule's options in your `webpack.conf.js`

```js
module: {
loaders: [{
rules: [{
test: /\.html$/,
loader: 'html',
query: {
minimize: true
}
use: [ {
loader: 'html-loader',
options: {
minimize: true
}
}],
}]
}
```
Expand Down Expand Up @@ -173,10 +175,10 @@ var path = require('path')
module.exports = {
...
module: {
loaders: [
rules: [
{
test: /\.html$/,
loader: "html-loader"
use: [ "html-loader" ]
}
]
},
Expand All @@ -194,10 +196,10 @@ If you need to define two different loader configs, you can also change the conf
module.exports = {
...
module: {
loaders: [
rules: [
{
test: /\.html$/,
loader: "html-loader?config=otherHtmlLoaderConfig"
use: [ "html-loader?config=otherHtmlLoaderConfig" ]
}
]
},
Expand Down Expand Up @@ -225,7 +227,7 @@ will write the _.html_ file for you. Example:
```js
{
test: /\.html$/,
loader: 'file-loader?name=[path][name].[ext]!extract-loader!html-loader'
use: [ 'file-loader?name=[path][name].[ext]!extract-loader!html-loader' ]
}
```

Expand Down