Also one option would be to check envoriment. And when building for production uglify removes unnecessary code. See more in uglify documentation.
I actually use this also for building multible different sites from one source.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.