Revert "FIX: Ensure sourcemap's source is correct"

This reverts commit 4553a0f6e0.
This commit is contained in:
romanrizzi 2020-01-22 16:31:34 -03:00
parent c7a8bbd6a5
commit 1de5b4ad64
1 changed files with 2 additions and 4 deletions

View File

@ -75,13 +75,11 @@ end
def compress_node(from, to)
to_path = "#{assets_path}/#{to}"
assets = cdn_relative_path("/assets")
assets_additional_path = (d = File.dirname(from)) == "." ? "" : "/#{d}"
source_map_root = assets + assets_additional_path
source_map_root = assets + ((d = File.dirname(from)) == "." ? "" : "/#{d}")
source_map_url = cdn_path "/assets/#{to}.map"
base_source_map = 'public/assets' + assets_additional_path
cmd = <<~EOS
uglifyjs '#{assets_path}/#{from}' -m -c -o '#{to_path}' --source-map "base='#{base_source_map}',root='#{source_map_root}',url='#{source_map_url}'"
uglifyjs '#{assets_path}/#{from}' -m -c -o '#{to_path}' --source-map "root='#{source_map_root}',url='#{source_map_url}'" --output '#{to_path}'
EOS
STDERR.puts cmd