Created
October 12, 2017 04:31
-
-
Save luke-denton-aligent/3b05af6804d3ee1eb80db8f13dd11688 to your computer and use it in GitHub Desktop.
A snippet of code to be added to the \Magento\Framework\View\Asset\Bundle\Manager::isValidAsset function, to create a list of JS files associated with an M2 storefront
This file contains hidden or 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
$destinationFile = "assets/js.txt"; | |
$name = $asset->getPath(); | |
$nameParts = explode('.', $name); | |
$extension = array_pop($nameParts); | |
if ($extension == 'js') { | |
file_put_contents($destinationFile, $name.PHP_EOL , FILE_APPEND | LOCK_EX); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment