mirror of
https://github.com/discourse/discourse.git
synced 2025-06-07 07:24:52 +08:00
DEV: Drop uglifyJS V2 support
This commit is contained in:
@ -78,15 +78,9 @@ def compress_node(from, to)
|
|||||||
source_map_root = assets + ((d = File.dirname(from)) == "." ? "" : "/#{d}")
|
source_map_root = assets + ((d = File.dirname(from)) == "." ? "" : "/#{d}")
|
||||||
source_map_url = cdn_path "/assets/#{to}.map"
|
source_map_url = cdn_path "/assets/#{to}.map"
|
||||||
|
|
||||||
cmd = if `uglifyjs -V`.match?(/2(.\d*){2}/)
|
cmd = <<~EOS
|
||||||
<<~EOS
|
|
||||||
uglifyjs '#{assets_path}/#{from}' -p relative -m -c -o '#{to_path}' --source-map-root '#{source_map_root}' --source-map '#{assets_path}/#{to}.map' --source-map-url '#{source_map_url}'
|
|
||||||
EOS
|
|
||||||
else
|
|
||||||
<<~EOS
|
|
||||||
uglifyjs '#{assets_path}/#{from}' -m -c -o '#{to_path}' --source-map "root='#{source_map_root}',url='#{source_map_url}'" --output '#{to_path}'
|
uglifyjs '#{assets_path}/#{from}' -m -c -o '#{to_path}' --source-map "root='#{source_map_root}',url='#{source_map_url}'" --output '#{to_path}'
|
||||||
EOS
|
EOS
|
||||||
end
|
|
||||||
|
|
||||||
STDERR.puts cmd
|
STDERR.puts cmd
|
||||||
result = `#{cmd} 2>&1`
|
result = `#{cmd} 2>&1`
|
||||||
|
Reference in New Issue
Block a user