I used to work in Microsoft Teams and the build time over there used to take about 25 minutes. It was big sync for developers' productivity.
I tried various optimizations in my local build by tuning various parameters in the package.json and changing the task runner from npm to yarn.
The most speed up I got was compiling my code on a powerful cloud instance. It cut the compile time of my code to half.
Check out this amazing tool https://stormyapp.com
It will help you reduce the compile time.