src/Manifest/ManifestLoader.php
public function loadManifest(\SplFileInfo $manifestFile, $build, $development = false)
    {
        $manifest = json_decode(file_get_contents($manifestFile->getPathname()), true);

        $pathMapper = function ($path) use ($build, $development) {
            return $this->pathMapper->mapPath($path, $build, $development);
        };

        $mapArray = function (array $u) use ($pathMapper) {
            $u['path'] = $pathMapper($u['path']);
            return $u;
        };

        $manifest['js']  = array_map($mapArray, $manifest['js']);
        $manifest['css'] = array_map($mapArray, $manifest['css']);

        if (isset($manifest['resources'])) {
            $manifest['resources'] = array_map($pathMapper, $manifest['resources']);
        }

        if ($development && isset($manifest['paths'])) {
            $manifest['paths'] = array_map($pathMapper, $manifest['paths']);
        }

        if ($development && isset($manifest['loadOrder'])) {
            $manifest['loadOrder'] = array_map($mapArray, $manifest['loadOrder']);
        }

        foreach (clone $this->manifestMutators as $manifestMutator) {
            $manifest = $manifestMutator($manifest, $build, $development);
        }

        return new Manifest($manifestFile->getPathname(), $manifest);
    }
public function loadManifest(\SplFileInfo $manifestFile, $build, $development = false)
    {
        $manifest = json_decode(file_get_contents($manifestFile->getPathname()), true);

        $pathMapper = function ($path) use ($build, $development) {
            return $this->pathMapper->mapPath($path, $build, $development);
        };

        $mapArray = function (array $u) use ($pathMapper) {
            $u['path'] = $pathMapper($u['path']);
            return $u;
        };

        $manifest['js']  = array_map($mapArray, $manifest['js']);
        $manifest['css'] = array_map($mapArray, $manifest['css']);

        if (isset($manifest['resources'])) {
            $manifest['resources'] = array_map($pathMapper, $manifest['resources']);
        }

        if ($development && isset($manifest['paths'])) {
            $manifest['paths'] = array_map($pathMapper, $manifest['paths']);
        }

        if ($development && isset($manifest['loadOrder'])) {
            $manifest['loadOrder'] = array_map($mapArray, $manifest['loadOrder']);
        }

        foreach (clone $this->manifestMutators as $manifestMutator) {
            $manifest = $manifestMutator($manifest, $build, $development);
        }

        return new Manifest($manifestFile->getPathname(), $manifest);
    }
{@inheritdoc}