Skip to content
Browse files

Don’t add sourceMappingURL if source maps are disabled.

  • Loading branch information...
1 parent 4bf0a0d commit 603760c15335d7a9e7b51926be0677a56a7dc358 @paulmillr paulmillr committed Jun 9, 2013
Showing with 4 additions and 3 deletions.
  1. +1 −1 .travis.yml
  2. +3 −2 src/fs_utils/generate.coffee
View
2 .travis.yml
@@ -3,4 +3,4 @@ branches:
- master
language: node_js
node_js:
- - 0.6
+ - '0.10'
View
5 src/fs_utils/generate.coffee
@@ -142,19 +142,20 @@ generate = (path, sourceFiles, config, optimizers, callback) ->
sorted = sort sourceFiles, config
{code, map} = concat sorted, path, type, config._normalized.modules.definition
+ withMaps = (map and config.sourceMaps)
optimize code, map, path, optimizer, config.optimize, (error, data, map) ->
return callback error if error?
- if map
+ if withMaps
base = sysPath.basename "#{path}.map"
if type is 'javascript'
data += "\n//@ sourceMappingURL=#{base}"
else
data += "\n/*@ sourceMappingURL=#{base}*/"
common.writeFile path, data, ->
- if map and config.sourceMaps
+ if withMaps
common.writeFile "#{path}.map", map.toString(), callback
else
callback()

0 comments on commit 603760c

Please sign in to comment.
Something went wrong with that request. Please try again.