cdn-url-loader
v0.1.2
Published
CDN and url loader module for webpack
Downloads
5
Readme
CDN and data url loader for webpack
Usage
The cdn-url
loader works like the file
loader, but can return a Data Url if the file is smaller than a limit. Otherwise it returns a link to a specified resource on a CDN.
The limit can be specified with a query parameter. (Defaults to no limit)
If the file is greater than the limit the CDN link is used.
require("cdn-url?limit=10000!./file.png");
// => DataUrl if "file.png" is smaller that 10kb
require("cdn-url?mimetype=image/png!./file.png");
// => Specify mimetype for the file (Otherwise it's inferred from extension.)
License
MIT (http://www.opensource.org/licenses/mit-license.php)