postcss-url
Advanced tools
Comparing version 7.2.1 to 7.3.0
@@ -0,1 +1,5 @@ | ||
#7.3.0 - 2017-10-26 | ||
Added: hash option - `append` (PR#114](https://github.com/postcss/postcss-url/pull/114)) | ||
#7.2.1 - 2017-10-19 | ||
@@ -2,0 +6,0 @@ |
{ | ||
"name": "postcss-url", | ||
"version": "7.2.1", | ||
"version": "7.3.0", | ||
"description": "PostCSS plugin to rebase or inline on url().", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -244,3 +244,8 @@ # postcss-url | ||
Result hash shrink count | ||
##### `append` | ||
_(default: `false`)_ | ||
Prepend the original filename in resulting filename | ||
--- | ||
@@ -247,0 +252,0 @@ |
@@ -9,3 +9,4 @@ 'use strict'; | ||
method: 'xxhash32', | ||
shrink: 8 | ||
shrink: 8, | ||
append: false | ||
}; | ||
@@ -24,7 +25,7 @@ | ||
const getHash = (content, options) => { | ||
if (typeof options.method === 'function') { | ||
if (options.method && typeof options.method === 'function') { | ||
return options.method(content); | ||
} | ||
if (options.method.indexOf('xxhash') === 0) { | ||
if (options.method && options.method.indexOf('xxhash') === 0) { | ||
return getxxhash(content, options); | ||
@@ -31,0 +32,0 @@ } |
@@ -16,3 +16,5 @@ 'use strict'; | ||
const getHashName = (file, options) => | ||
calcHash(file.contents, options) + path.extname(file.path); | ||
(options && options.append ? (`${path.basename(file.path, path.extname(file.path))}_`) : '') | ||
+ calcHash(file.contents, options) | ||
+ path.extname(file.path); | ||
@@ -19,0 +21,0 @@ /** |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36940
653
266