-
-
Save markusvonplunkett/fce64b3825a04985653162e934c962e2 to your computer and use it in GitHub Desktop.
Identify used Magento 2 frontend extensions in a Luma install
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
<?php | |
// Run with the URL pointing to a require-config.js as the first argument; | |
// php identify.php http://magento2demo.firebearstudio.com/pub/static/frontend/Magento/luma/en_US/requirejs-config.js | |
$content = file_get_contents($argv[1]); | |
preg_match_all( | |
'/(?P<quote>\'|")(?P<extension>[[:alnum:]]+_[[:alnum:]]+)\/js\/.+?(?P=quote)/m', | |
$content, | |
$matches | |
); | |
sort($matches['extension']); | |
print_r(array_unique($matches['extension'])); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Javascript version you can use in your console on a Magento2 site (with RequireJS)
[...new Set(Object.entries(requirejs.s.contexts._.config.map['*']).filter(path => path[1].includes('') && path[1].includes('/js/')).map(path => path[1].split('/')[0]).sort())]