Make Asset Compression On Production Work With Angular Js

Posted By Weston Ganger

<p>For AngularJS and likely others too, the javascript minification changes variable names to short names. This must be changed although it will make your minification slightly less minified, its the way it must be done so that it works on production.</p>
<p>Edit your config/environments/production.rb</p>
<p>The old Rails 3 way of doing it was:</p>

config.assets.js_compressor = Uglifier.new(:mangle => false)

Article Topic:Software Development - Ruby / Rails

Date:July 15, 2014