Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
Don’t add sourceMappingURL if source maps are disabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Jun 8, 2013
1 parent 4bf0a0d commit 603760c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ branches:
- master
language: node_js
node_js:
- 0.6
- '0.10'
5 changes: 3 additions & 2 deletions src/fs_utils/generate.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 603760c

Please sign in to comment.