postcss-url
Advanced tools
Comparing version 4.0.0 to 4.0.1
@@ -0,1 +1,6 @@ | ||
# 4.0.1 - 2015-08-06 | ||
- Fixed: copy/rename of hash and query string for filenames | ||
([#40](https://github.com/postcss/postcss-url/pull/40)) | ||
# 4.0.0 - 2015-06-18 | ||
@@ -2,0 +7,0 @@ |
16
index.js
@@ -230,8 +230,8 @@ /** | ||
if (basePath) { | ||
fullFilePath = path.join(basePath, urlMeta.value) | ||
fullFilePath = path.join(basePath, link.pathname) | ||
} | ||
else { | ||
fullFilePath = dirname !== from | ||
? dirname + path.sep + urlMeta.value | ||
: urlMeta.value | ||
? dirname + path.sep + link.pathname | ||
: link.pathname | ||
} | ||
@@ -245,3 +245,2 @@ | ||
var mimeType = mime.lookup(file) | ||
var stats = fs.statSync(file) | ||
@@ -253,2 +252,4 @@ | ||
var mimeType = mime.lookup(file) | ||
if (!mimeType) { | ||
@@ -288,3 +289,3 @@ result.warn("Unable to find asset mime-type for " + file, {node: decl}) | ||
if (from === to) { | ||
result.warn("Option `to` of postscss is required, ignoring", {node: decl}) | ||
result.warn("Option `to` of postcss is required, ignoring", {node: decl}) | ||
return createUrl(urlMeta) | ||
@@ -302,3 +303,4 @@ } | ||
// e.g., url('glyphicons-halflings-regular.eot?#iefix') | ||
var filePath = url.parse(filePathUrl, true).pathname | ||
var fileLink = url.parse(filePathUrl, true) | ||
var filePath = fileLink.pathname | ||
var name = path.basename(filePath) | ||
@@ -327,4 +329,4 @@ var useHash = options.useHash || false | ||
.substr(0, 16) | ||
nameUrl = name + path.extname(filePathUrl) | ||
name += path.extname(filePath) | ||
nameUrl = name + (fileLink.search || "") + (fileLink.hash || "") | ||
} | ||
@@ -331,0 +333,0 @@ else { |
{ | ||
"name": "postcss-url", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "PostCSS plugin to rebase or inline on url().", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -51,3 +51,3 @@ # postcss-url [![Build Status](https://travis-ci.org/postcss/postcss-url.png)](https://travis-ci.org/postcss/postcss-url) | ||
Allow you to inline assets using base64 syntax. Can use postcss `from` option to find ressources. | ||
Allow you to inline assets using base64 encoding. Can use postcss `from` option to find ressources. | ||
@@ -83,3 +83,3 @@ ##### `url: "copy"` | ||
Specify the base path from where to search images | ||
Specify the base path where to search images from | ||
@@ -90,3 +90,3 @@ #### `assetsPath` | ||
If you specify an `assetsPath`, the assets files would be copy in that | ||
If you specify an `assetsPath`, the assets files will be copied in that | ||
destination | ||
@@ -98,3 +98,3 @@ | ||
If is set in true the copy method is going to rename the path of the files by a hash name | ||
If set to `true` the copy method is going to rename the path of the files by a hash name | ||
@@ -101,0 +101,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
17265
316