protected function transformAsyncModuleMapping()
{
$finalMapping = [];
foreach ($this->asyncModuleMapping as $path => $modules) {
if (preg_match('#resource://([^/]+)/Public/(.*)#', $path, $matches) === 1) {
$packageKey = $matches[1];
$path = $matches[2];
$realPath = $this->resourceManager->getPublicPackageResourceUri($packageKey, $path);
foreach ($modules as $module => $activated) {
if ($activated) {
$finalMapping[$module] = $realPath;
}
}
continue;
}
throw new \Exception(sprintf('"%s" is not a valid path to a public JavaScript. ' . 'Please provide a resource path ("resource://...")', $path), 1462703658);
}
return $finalMapping;
}