protected function transformLegacyModuleMapping()
{
$finalMapping = [];
foreach ($this->legacyModuleMapping 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 => $migratesTo) {
$finalMapping[$module] = ['target' => $realPath, 'migratesTo' => $migratesTo];
}
continue;
}
throw new \Exception(sprintf('"%s" is not a valid path to a public JavaScript. ' . 'Please provide a resource path ("resource://...")', $path), 1463923183);
}
return $finalMapping;
}