a copy of webpack file loader without file emit
=====================================
file loader for webpack
Usage
var url = ;// => emits file.png as file in the output directory and returns the public url// => returns i. e. "/public-path/0dcbbaa701328a3c262cfd45869e351f.png"
By default the filename is the md5 hash of the file and the extension of the required resource is appended.
You can configure a custom filename template for your file (query param name
).
[ext]
the extension of the resource[name]
the basename of the resource[path]
the path of the resource relative to thecontext
query parameter or option.[hash]
the hash or the content[<hashType>:hash:<digestType>:<length>]
optionally you can configure- other
hashType
s, i. e.sha1
,md5
,sha256
,sha512
- other
digestType
s, i. e.hex
,base26
,base32
,base36
,base49
,base52
,base58
,base62
,base64
- and
length
the length in chars
- other
[N]
the N-th match obtained from matching the current file name against the query paramregExp
Examples
;// => js/0dcbbaa701328a3c262cfd45869e351f.script.js;// => html-109fa8.html;// => c31e9820c001c9c4a86bce33ce43b679;// => gdyb21L.png// use sha512 hash instead of md5 and with only 7 chars of base64;// => img-VqzT5ZC.jpg// use custom name, sha512 hash instead of md5 and with only 7 chars of base64;// => picture.png// => dir/file.png?e43b20c069c4a01867c31e98cbce33c9
License
MIT (http://www.opensource.org/licenses/mit-license.php)