diff --git a/lib/parser.js b/lib/parser.js index be0ab18..f99df2f 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -29,10 +29,12 @@ // Accumulate files this.parse = function(vinyl){ var data = vinyl.contents.toString('utf8'); + + vinyl.base = vinyl.cwd; // Don't treat empty files if (data.length){ - filemap[vinyl.path] = data; - dirmap[vinyl.path] = vinyl.cwd; + filemap[vinyl.relative] = data; + dirmap[vinyl.relative] = vinyl.cwd; } }; diff --git a/test/expected/hello.txt b/test/expected/hello.txt index 6903f79..d6acf34 100644 --- a/test/expected/hello.txt +++ b/test/expected/hello.txt @@ -1 +1 @@ -{"project":{},"files":{"test/fixtures/hello.txt":{"name":"test/fixtures/hello.txt","modules":{"fixture":1},"classes":{},"fors":{},"namespaces":{}}},"modules":{"fixture":{"name":"fixture","submodules":{},"classes":{},"fors":{},"namespaces":{},"tag":"module","file":"test/fixtures/hello.txt","line":1}},"classes":{},"classitems":[],"warnings":[]} \ No newline at end of file +{"project":{},"files":{"fixtures/hello.txt":{"name":"fixtures/hello.txt","modules":{"fixture":1},"classes":{},"fors":{},"namespaces":{}}},"modules":{"fixture":{"name":"fixture","submodules":{},"classes":{},"fors":{},"namespaces":{},"tag":"module","file":"fixtures/hello.txt","line":1}},"classes":{},"classitems":[],"warnings":[]} \ No newline at end of file