Closed jcuenod closed 9 years ago
Are the empty IIFEs present also in non-uglified JS? My first guess would be that there are CoffeeScript files that are empty or only has Sprockets requires.
There are some but surely this is not useful behaviour?
CoffeeScript wraps all files to a function that is invoked immediately. This prevents variable declarations from multiple files from interfering with each other when the files are concatenated (which is what Rails asset pipeline is doing). Sure, those empty functions could be removed in minification process, but UglifyJS isn't currently able to perform such optimisation.
Okay, so the solution is delete empty (auto-generated) files?
Yes, that should at least remove some of the functions. They don't really hurt you much anyway. Repetitive code should compress well.
At the end of my uglified js on heroku, I have:
I must be honest, I'm not sure how to begin debugging this.