Skip to content

Instantly share code, notes, and snippets.

@vortizhe
Created March 9, 2016 16:44
Show Gist options
  • Save vortizhe/b512fa7baf4eab4186ef to your computer and use it in GitHub Desktop.
Save vortizhe/b512fa7baf4eab4186ef to your computer and use it in GitHub Desktop.
Replace asset pipeline ruby uglifyjs with node version
require 'open3'
class NodeUglify
def compress(input)
output = ''
Open3.popen3('uglifyjs') do |i, o, t|
i.puts input
i.close
while line = o.gets
output += line
end
end
output
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment