Skip to content
This repository was archived by the owner on Jun 25, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ module.exports = function(options){
}

function transform(options) {
options = options || {}
return function(file, enc, cb){
var contents
var transformed
var options = options || {}
if(file.isStream()) {
return cb(
new PluginError("gulp-cssnext", "streaming not supported")
Expand Down
43 changes: 43 additions & 0 deletions test/cssnext.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,46 @@ tape("throws on cssnext error", function(test){
})
stream.end(file)
})

tape("Resolves relative paths for consecutive files in different paths", function(test) {
var stream = cssnext()
var file = new gutil.File({
base: "./fixtures/",
path: "./fixtures/import.css",
contents: new Buffer(
fs.readFileSync(
path.resolve(__dirname, "./fixtures/import.css"),
"utf8"
)
)
})
stream.write(file)

var file2 = new gutil.File({
base : "./fixtures/import/",
path : "./fixtures/import/index.css",
contents : new Buffer(
fs.readFileSync(
path.resolve(__dirname, "./fixtures/import/index.css"),
"utf8"
)
)
})
stream.write(file2)

var count = 0;
stream.on("data", function(file){

test.equal(
file.contents.toString(),
fs.readFileSync(
path.resolve(__dirname, "./expected/index.css"),
"utf8"
)
)
++count
if(count == 2) {
test.end()
}
})
})
1 change: 1 addition & 0 deletions test/fixtures/import.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import './index.css';
1 change: 1 addition & 0 deletions test/fixtures/import/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import '../index.css';