Correctly clear unused javascripts for production packaging