@dpobel showed me where it is done in legacy: https://github.com/ezsystems/ezpublish-legacy/blob/master/extension/ezjscore/classes/ezjscpacker.php#L84