gulp-usemin
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -15,3 +15,3 @@ var path = require('path'); | ||
var cssReg = /<\s*link\s+.*href\s*=\s*"([^"]+)".*>/gi; | ||
var mainPath, mainName, alternatePath; | ||
var basePath, mainPath, mainName, alternatePath; | ||
var filesCount = 0; | ||
@@ -21,3 +21,3 @@ | ||
return new gutil.File({ | ||
path: name, | ||
path: path.join(path.relative(basePath, mainPath), name), | ||
contents: new Buffer(content) | ||
@@ -99,3 +99,4 @@ }); | ||
else { | ||
mainPath = file.base; | ||
basePath = file.base; | ||
mainPath = path.dirname(file.path); | ||
mainName = path.basename(file.path); | ||
@@ -102,0 +103,0 @@ |
{ | ||
"name": "gulp-usemin", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Replaces references to non-optimized scripts or stylesheets into a set of HTML files (or any templates/views).", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -194,4 +194,4 @@ /* jshint node: true */ | ||
it('simple with path (css block)', function(done) { | ||
var name = 'data/css/style.css'; | ||
var expectedName = 'data/css/min-style.css'; | ||
var name = path.join('data', 'css', 'style.css'); | ||
var expectedName = path.join('data', 'css', 'min-style.css'); | ||
var exist = false; | ||
@@ -215,4 +215,4 @@ | ||
it('simple with alternate path (css block)', function(done) { | ||
var name = 'data/css/style.css'; | ||
var expectedName = 'data/css/min-style.css'; | ||
var name = path.join('data', 'css', 'style.css'); | ||
var expectedName = path.join('data', 'css', 'min-style.css'); | ||
var exist = false; | ||
@@ -267,3 +267,3 @@ | ||
it('simple with path (css block)', function(done) { | ||
var expectedName = 'data/css/style.css'; | ||
var expectedName = path.join('data', 'css', 'style.css'); | ||
var exist = false; | ||
@@ -287,3 +287,3 @@ | ||
it('simple with alternate path (css block)', function(done) { | ||
var expectedName = 'data/css/style.css'; | ||
var expectedName = path.join('data', 'css', 'style.css'); | ||
var exist = false; | ||
@@ -339,4 +339,4 @@ | ||
it('simple with path (js block)', function(done) { | ||
var name = 'data/js/app.js'; | ||
var expectedName = 'data/js/min-app.js'; | ||
var name = path.join('data', 'js', 'app.js'); | ||
var expectedName = path.join('data', 'js', 'min-app.js'); | ||
var exist = false; | ||
@@ -360,4 +360,4 @@ | ||
it('simple with alternate path (js block)', function(done) { | ||
var name = 'data/js/app.js'; | ||
var expectedName = 'data/js/min-app.js'; | ||
var name = path.join('data', 'js', 'app.js'); | ||
var expectedName = path.join('data', 'js', 'min-app.js'); | ||
var exist = false; | ||
@@ -412,3 +412,3 @@ | ||
it('simple with path (js block)', function(done) { | ||
var expectedName = 'data/js/app.js'; | ||
var expectedName = path.join('data', 'js', 'app.js'); | ||
var exist = false; | ||
@@ -432,3 +432,3 @@ | ||
it('simple with alternate path (js block)', function(done) { | ||
var expectedName = 'data/js/app.js'; | ||
var expectedName = path.join('data', 'js', 'app.js'); | ||
var exist = false; | ||
@@ -435,0 +435,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
22091
498