Do you want to request a feature or report a bug?
Bug/Question?
What is the current behavior?
This:
{
test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
loader: 'url-loader',
options: {
limit: 10000,
name: 'static/media/[name].[hash:8].[ext]'
}
},
will be converted to this:
{
test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
use: [{
loader: 'url-loader'
}],
options: {
limit: 10000,
name: 'static/media/[name].[hash:8].[ext]'
}
},
Question is: is this correct result or should options be grouped with the loader?
cc @sokra
Any status update on this?
@okonet - Can options be bound to multiple loaders? Isn't it more clearer to group them with the loaders?
Can options be bound to multiple loaders?
I don't know! That's why I've created this issue.
According to the webpack TypeScript definition files, a UseRule (i.e. a rule with a use property) can not have an options property.
So you either need to continue using a LoaderRule (i.e. loader and options properties, or you need to specify the options in the use property, either as an object or as an array.
Thanks @schmuli! I'll need to update code to make this happen.
@okonet @pksjce any of you guys got time to do this?
I will take a crack at this, the out put should be something like this right ?
{
test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
use: [{
loader: 'url-loader'
},
options: {
limit: 10000,
name: 'static/media/[name].[hash:8].[ext]'
}]
},
Most helpful comment
Thanks @schmuli! I'll need to update code to make this happen.