Move previous logics from Gruntfile.js to this file, need to be fixed later.