Created
October 22, 2018 02:41
-
-
Save LuenCC/667a3d1518767b8c9638789d32e293bb to your computer and use it in GitHub Desktop.
Assets path manifest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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