gulp-shopify-sass
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -17,6 +17,5 @@ 'use strict'; | ||
var fileContents = file.contents.toString(); | ||
var fileDirname = file.base; | ||
var fileDirname = path.dirname(file.path); | ||
var imports = {}; | ||
var match; | ||
while(match = rex.exec(fileContents)) { | ||
@@ -40,3 +39,3 @@ | ||
// replace @import with import file contents | ||
fileContents = fileContents.replace(imp, importReplacer(vfile.readSync(importFile)).contents.toString()); | ||
fileContents = fileContents.replace(imp, importReplacer(vfile.readSync(imports[imp])).contents.toString()); | ||
} | ||
@@ -43,0 +42,0 @@ |
{ | ||
"name": "gulp-shopify-sass", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Concatenate Sass files defined by the @import order", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
@@ -45,3 +45,2 @@ var assert = require('stream-assert'); | ||
gulp.src('./test/fixtures/b.scss') | ||
// test('@import "a.scss";') | ||
.pipe(gulpShopifySass()) | ||
@@ -53,4 +52,12 @@ .pipe(assert.length(1)) | ||
it('replace import recursively', function (done) { | ||
test('@import "b.scss";') | ||
.pipe(gulpShopifySass()) | ||
.pipe(assert.length(1)) | ||
.pipe(assert.first(function(f){f.contents.toString().should.equal('.class-name {}')})) | ||
.pipe(assert.end(done)); | ||
}); | ||
}); | ||
}); |
6654
112