file-loader
Advanced tools
Comparing version 0.8.0 to 0.8.1
@@ -14,3 +14,4 @@ /* | ||
context: query.context || this.options.context, | ||
content: content | ||
content: content, | ||
regExp: query.regExp | ||
}); | ||
@@ -17,0 +18,0 @@ this.emitFile(url, content); |
{ | ||
"name": "file-loader", | ||
"version": "0.8.0", | ||
"version": "0.8.1", | ||
"author": "Tobias Koppers @sokra", | ||
@@ -5,0 +5,0 @@ "description": "file loader module for webpack", |
@@ -21,5 +21,7 @@ # file loader for webpack | ||
* `[hash]` the hash or the content | ||
* query param `hash` allows to choose a algorithm (default `md5`) | ||
* query param `digest` allows to choose the type of digest (default `hex`) | ||
* query param `size` allows to choose the length of the hash in chars | ||
* `[<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 | ||
* `[N]` the N-th match obtained from matching the current file name against the query param `regExp` | ||
@@ -32,3 +34,3 @@ Examples | ||
require("file?name=html-[hash].html&size=6!./page.html"); | ||
require("file?name=html-[hash:6].html!./page.html"); | ||
// => html-109fa8.html | ||
@@ -39,6 +41,10 @@ | ||
require("file?hash=sha512&size=7&digest=base64!./image.png"); | ||
require("file?name=[sha512:hash:base64:7].[ext]!./image.png"); | ||
// => gdyb21L.png | ||
// use sha512 hash instead of md5 and with only 7 chars of base64 | ||
require("file?name=img-[sha512:base64:7].[ext]!./image.jpg"); | ||
// => img-VqzT5ZC.jpg | ||
// use custom name, sha512 hash instead of md5 and with only 7 chars of base64 | ||
require("file?name=picture.png!./myself.png"); | ||
@@ -45,0 +51,0 @@ // => picture.png |
6423
73
57