image-size-loader
image-size-loader copied to clipboard
Add more explanation around the "Filename placeholders"
Its not clear to me from the documentation how the filename placeholders might be used. Could it be elaborated on, or perhaps an example given?
Filename placeholders are from the webpack loader docs. The source is mentioned just below that.
Example usage is given here - https://github.com/boopathi/image-size-loader#query-params
One more example - https://github.com/flipkart-incubator/phrontend-webpack/blob/master/src/webpack-config.js#L56
The line number may change, so this commit link might help in future.
Yeah I mean, i read the readme (its short enough), and i read the docs that part linked to. I just still don't understand why you'd use it or what it does. Neither of the examples you just gave make it clear me. Maybe its one of those things that if I don't know, then i don't need it?
I'm not sure. This example might be of some help - https://github.com/webpack/file-loader#examples.
And it's the same placeholders you'd give to the output.filename
of webpack - http://webpack.github.io/docs/configuration.html#output-filename
Oh, so if you add those parameters then it saves the file in a location on-disk, rather than creating a data:
url?
image-size-loader doesn't yet support emitting data:
url. The image file is copied from the source to the target (output.path
) directory and this name
with placeholders is used as the new name for the file.