postcss-import
Advanced tools
Comparing version 5.1.0 to 5.1.1
@@ -1,3 +0,7 @@ | ||
# 5.1.0 - 2015-02-17 | ||
# 5.1.1 - 2015-04-10 | ||
- Fixed: regression of 5.1.0: files which only contain same @import rules were skip ([#31](https://github.com/postcss/postcss-import/issues/31)) | ||
# 5.1.0 - 2015-03-27 | ||
- Added: files with the same content will only be imported once. Previously, only the full path was used to determine if a file has already been imported in a given scope. | ||
@@ -4,0 +8,0 @@ Now, we also test create a hash with the content of the file to check if a file with the same content has not already been imported. |
24
index.js
@@ -194,15 +194,19 @@ "use strict"; | ||
var fileContentHash = hash(fileContent) | ||
// skip files wich only contain @import rules | ||
var newFileContent = fileContent.replace(/@import (.*);/,"") | ||
if (newFileContent.trim() !== "") { | ||
var fileContentHash = hash(fileContent) | ||
// skip files already imported at the same scope and same hash | ||
if (hashFiles[fileContentHash] && hashFiles[fileContentHash][media]) { | ||
detach(atRule) | ||
return | ||
} | ||
// skip files already imported at the same scope and same hash | ||
if (hashFiles[fileContentHash] && hashFiles[fileContentHash][media]) { | ||
detach(atRule) | ||
return | ||
} | ||
// save hash files to skip them next time | ||
if (!hashFiles[fileContentHash]) { | ||
hashFiles[fileContentHash] = {} | ||
// save hash files to skip them next time | ||
if (!hashFiles[fileContentHash]) { | ||
hashFiles[fileContentHash] = {} | ||
} | ||
hashFiles[fileContentHash][media] = true | ||
} | ||
hashFiles[fileContentHash][media] = true | ||
@@ -209,0 +213,0 @@ var newStyles = postcss.parse(fileContent, options) |
{ | ||
"name": "postcss-import", | ||
"version": "5.1.0", | ||
"version": "5.1.1", | ||
"description": "PostCSS plugin to import CSS files", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
19418
311