Skip to content

Commit

Permalink
#174 Problems with source maps
Browse files Browse the repository at this point in the history
  • Loading branch information
azproduction committed Feb 10, 2014
1 parent 57cf803 commit 743ff30
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bin/lmd_builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -1419,7 +1419,8 @@ LmdBuilder.prototype.createSourceMap = function (modules, sourceWithTokens, conf
var configRoot = String(config.root || config.path || ''),
configOutput = String(config.output || ''),
configWwwRoot = String(config.www_root || ''),
configSourcemapWww = String(config.sourcemap_www || '/'),
// #174 apply default value only for non-strings
configSourcemapWww = typeof config.sourcemap_www === 'string' ? config.sourcemap_www : '/',
configSourcemap = String(config.sourcemap || ''),
configSourceMappingURL = String(config.sourcemap_url || '');

Expand Down Expand Up @@ -1452,7 +1453,8 @@ LmdBuilder.prototype.createSourceMap = function (modules, sourceWithTokens, conf
}

var offset = self.getModuleOffset(sourceWithTokens, tokenIndex),
source = path.relative(root, module.path);
// #174 replace back slashes with front slashes
source = path.relative(root, module.path).replace(/\\/g, '/');

// add mapping for each line
for (var i = 0; i < module.lines; i++) {
Expand Down

0 comments on commit 743ff30

Please sign in to comment.