All my javascripts stopped working in production when I compiled them into application.js. I fixed this issue by turning asset debug on in production like so:
config.serve_static_assets = false
# Compress JavaScripts and CSS
config.assets.compress = false
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = true
# Generate digests for assets URLs
config.assets.digest = true
config.assets.debug = true
my question is if there are any problems with leaving asset debug on in production mode besides people being able to see my js files. Is there a setting I’m missing that would allow me to compress the JS and it still would work? I’d like to be able to compress them but the javascript just isn’t loading when I try it.
Sometimes compressed js just doesn’t work, could be because of the order it was done, or something else.