Skip to content

Commit

Permalink
fixes #426, detect existing inline source map
Browse files Browse the repository at this point in the history
  • Loading branch information
dbashford committed Jan 23, 2015
1 parent 54d9355 commit 1377933
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/modules/compilers/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ module.exports = JSCompiler = (function() {

JSCompiler.prototype.__sourceMap = function(file, output, sourceMap) {
var base64SourceMap, datauri;
if (output.indexOf("sourceMappingURL=") > -1) {
return output;
}
if (typeof sourceMap === "string") {
sourceMap = JSON.parse(sourceMap);
}
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"commander": "1.3.2",
"lodash": "2.4.1",
"logmimosa": "1.0.3",
"mimosa-6to": "^0.1.10",
"mimosa-bower": "1.8.1",
"mimosa-copy": "1.3.1",
"mimosa-csslint": "2.0.1",
Expand Down
4 changes: 4 additions & 0 deletions src/modules/compilers/javascript.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ module.exports = class JSCompiler
next()

__sourceMap: (file, output, sourceMap) ->
# already has source map?
if output.indexOf("sourceMappingURL=") > -1
return output

# parse source map to object
if typeof sourceMap is "string"
sourceMap = JSON.parse(sourceMap)
Expand Down

0 comments on commit 1377933

Please sign in to comment.