Skip to content

Instantly share code, notes, and snippets.

@LuenCC
Created October 22, 2018 02:41
Show Gist options
  • Save LuenCC/667a3d1518767b8c9638789d32e293bb to your computer and use it in GitHub Desktop.
Save LuenCC/667a3d1518767b8c9638789d32e293bb to your computer and use it in GitHub Desktop.
Assets path manifest.json
function asset_path($filename) {
$manifest_path = '../dist/rev-manifest.json';
if (file_exists($manifest_path)) {
$manifest = json_decode(file_get_contents($manifest_path), TRUE);
} else {
$manifest = [];
}
if (array_key_exists($filename, $manifest)) {
return $manifest[$filename];
}
return $filename;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment