The function was already returning a Promise, but still using a lot of sync APIs. Refactored this to use Promises and async APIs internally.
Originally the intention was to also offload the Uglify call to a workerpool (thus requiring async processing). This was to not only analyze the whole bundled file in a worker, but also the uglification of each contained module, in order to get some better CPU utilization. But in practice this did not yield any noticeable improvements, so skipping this...
The function was already returning a Promise, but still using a lot of sync APIs. Refactored this to use Promises and async APIs internally.
Originally the intention was to also offload the Uglify call to a workerpool (thus requiring async processing). This was to not only analyze the whole bundled file in a worker, but also the uglification of each contained module, in order to get some better CPU utilization. But in practice this did not yield any noticeable improvements, so skipping this...