Skip to content

Commit

Permalink
Fix incorrect filenames in sourcemap comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Panya committed Jan 14, 2015
1 parent 3ca586c commit 002e4c8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/visitor/sourcemapper.js
Expand Up @@ -38,15 +38,14 @@ var SourceMapper = module.exports = function SourceMapper(root, options){
this.basePath = sourcemap.basePath || '.';
this.inline = sourcemap.inline;
this.comment = sourcemap.comment;
var filename;
if (extname(this.dest) === '.css') {
filename = basename(this.dest);
this.basename = basename(this.dest);
} else {
filename = basename(this.filename, extname(this.filename)) + '.css';
this.basename = basename(this.filename, extname(this.filename)) + '.css';
}

this.map = new SourceMapGenerator({
file: filename,
file: this.basename,
sourceRoot: sourcemap.sourceRoot || null
});
Compiler.call(this, root, options);
Expand All @@ -68,7 +67,7 @@ SourceMapper.prototype.__proto__ = Compiler.prototype;
var compile = Compiler.prototype.compile;
SourceMapper.prototype.compile = function(){
var css = compile.call(this)
, out = basename(this.filename, extname(this.filename)) + '.css.map'
, out = this.basename + '.map'
, url = this.normalizePath(this.dest
? join(this.dest, out)
: join(dirname(this.filename), out))
Expand Down

0 comments on commit 002e4c8

Please sign in to comment.