Comparing version 0.2.1 to 0.2.2
@@ -50,2 +50,4 @@ "use strict"; | ||
exports.existsSync = fs.existsSync; | ||
exports.existsSync = fs.existsSync; | ||
exports.statSync = fs.statSync; |
@@ -0,0 +0,0 @@ "use strict"; |
"use strict"; | ||
var path = require("path"); | ||
var md5 = require("MD5"); | ||
var minimatch = require("minimatch"); | ||
@@ -11,2 +10,3 @@ var hashpattern = require("./hash-pattern"); | ||
var cssProcessor = require("./css-processor"); | ||
var hashcodeGenerator = require("./hashcode-generator"); | ||
@@ -16,7 +16,2 @@ // Singleton for global, cross cutting options | ||
// Gets an MD5 hash for the specified fullPath | ||
var getHashCode = function (fullPath) { | ||
return md5(fsutil.readFileSync(fullPath)); | ||
}; | ||
var getManifestPath = function (directory, serializer) { | ||
@@ -26,14 +21,2 @@ return path.join(directory, "manifest" + serializer.extension); | ||
// var _staticTypes = { | ||
// ".js": true, | ||
// ".css": true, | ||
// ".pdf": true, | ||
// ".jpg": true, | ||
// ".png": true, | ||
// ".gif": true, | ||
// ".bmp": true, | ||
// ".tiff": true, | ||
// ".webp": true | ||
// }; | ||
var compare = function (a, b) { | ||
@@ -55,3 +38,3 @@ if (a < b) { | ||
var targetDir = path.dirname(targetPath); | ||
var hashedPathPhysical = hashpattern.getHashedFileName(fullPath, targetDir, hashCode || getHashCode(fullPath)); | ||
var hashedPathPhysical = hashpattern.getHashedFileName(fullPath, targetDir, hashCode || hashcodeGenerator.generateForFile(fullPath, _options.quickhash)); | ||
var hashedPath = path.relative(targetBasePath, hashedPathPhysical); | ||
@@ -100,3 +83,3 @@ | ||
var entry = createManifestEntry(fullPath, basePath, targetDir, data, md5(transformedCssText)); | ||
var entry = createManifestEntry(fullPath, basePath, targetDir, data, hashcodeGenerator.generate(transformedCssText)); | ||
@@ -312,3 +295,3 @@ entry.transformedText = transformedCssText; | ||
if (fsutil.existsSync(manifestPath)) { | ||
existingManifestData = serializer.parse(fsutil.readFileSync(manifestPath)); | ||
existingManifestData = serializer.parse(fsutil.readFileSync(manifestPath, "utf8")); | ||
existingManifestData.forEach(function (entry) { | ||
@@ -315,0 +298,0 @@ entry.pathPhysical = baseDir + entry.path; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -20,2 +20,5 @@ usage: hashly [option option=parameter ...] <source> [destination] | ||
(and root relative) image paths will be replaced with the hashed version. | ||
-q, --quickhash Use the file size for binary files instead of the file contents. This makes processing large binary | ||
files extremely quick, though at a (extremely slight) risk that a hashcode will not change when a | ||
file is updated. | ||
--ignore-errors Ignore errors. Otherwise, hashly will abort on the first error. |
{ | ||
"name": "hashly", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Renames static files with a hashcode for cache busting", | ||
@@ -5,0 +5,0 @@ "directories": { |
@@ -50,2 +50,5 @@ hashly [![Build Status](https://secure.travis-ci.org/labaneilers/hashly.png?branch=master)](http://travis-ci.org/labaneilers/hashly) | ||
(and root relative) image paths will be replaced with the hashed version. | ||
-q, --quickhash Use the file size for binary files instead of the file contents. This makes processing large binary | ||
files extremely quick, though at a (extremely slight) risk that a hashcode will not change when a | ||
file is updated. | ||
--ignore-errors Ignore errors. Otherwise, hashly will abort on the first error. | ||
@@ -52,0 +55,0 @@ ``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
52474
20
578
128