The existing custom build solutions with Grunt do not support an optimized build, where only the required modules are included:
https://developers.arcgis.com/javascript/latest/guide/using-bower/index.html
https://github.com/Esri/enterprise-build-sample-js