grunt-forcemin
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -6,3 +6,3 @@ { | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
@@ -9,0 +9,0 @@ "homepage": "https://github.com/msafi/grunt-forcemin", |
@@ -38,3 +38,3 @@ # forcemin | ||
```shell | ||
npm install forcemin --save-dev | ||
npm install grunt-forcemin --save-dev | ||
``` | ||
@@ -45,3 +45,3 @@ | ||
```js | ||
grunt.loadNpmTasks('forcemin'); | ||
grunt.loadNpmTasks('grunt-forcemin'); | ||
``` | ||
@@ -48,0 +48,0 @@ |
@@ -23,11 +23,2 @@ /* | ||
function(filepath) { | ||
var filename = path.basename(filepath) | ||
// Make sure there are at least two dots in the name. Otherwise it means the file is not versioned and should | ||
// not be added to the dictionary | ||
if (filename.match(/[.]/g).length < 2) { | ||
grunt.log.warn("\n" + filename + ' doesn\'t look revisioned. (Skipped)\n') | ||
return false | ||
} | ||
if (!grunt.file.exists(filepath)) { | ||
@@ -47,2 +38,9 @@ grunt.log.warn('Source file "' + filepath + '" not found.') | ||
// Make sure there are at least two dots in the name. Otherwise it means the file is not versioned and should | ||
// not be added to the dictionary | ||
if (filename.match(/[.]/g).length < 2) { | ||
grunt.log.warn("\n'" + filename + '\' doesn\'t look revisioned. References to it won\'t be updated.\n') | ||
return | ||
} | ||
unversionedFilename = filename.replace(/^(.*?)\./, '') | ||
@@ -49,0 +47,0 @@ dictionary[unversionedFilename] = filename |
@@ -48,6 +48,7 @@ 'use strict'; | ||
it('should not consider files that have fewer than two dots in them', function(done) { | ||
fileOperatedOn = bootstrap(['test/temp/robots.txt']) | ||
it('should not add files with fewer than two dots to dictionary, but should still update their contents', function(done) { | ||
fileOperatedOn = bootstrap(['test/temp/robots.txt', 'test/temp/mc4593fc.second.script.js.map']) | ||
expect(fileOperatedOn.robots).to.be('robots.txt') | ||
expect(grunt.file.read("test/temp/robots.txt")).to.be('mc4593fc.second.script.js.map') | ||
done() | ||
@@ -54,0 +55,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
10760