I would like to remove calls to unused js, css, and fonts such as fontawesome and openiconic from a Magezon extension on the front end. I am only using the extension as a basic grid layout system.
For example, I am not using either font library and they just add unnecessary overhead.
Under the app/ folder I found FontAwesome being present in the following files using a grep command.
FontAwesome
./code/Magezon/PageBuilder/Data/Element/MessageBox.php
./code/Magezon/Builder/Model/Source/FontAwesome4List.php
./code/Magezon/Builder/Model/Source/FontAwesomeList.php
./code/Magezon/Builder/etc/di.xml
./code/Magezon/Builder/Data/Form/Element/Icon.php
./code/Magezon/Builder/i18n/en_US.csv
./code/Magezon/Builder/view/base/web/js/form/element/icon.js
./code/Magezon/Core/Model/Source/FontAwesomeList.php
./code/Magezon/Core/Plugin/View/Result/Layout.php
./code/Magezon/Core/view/base/web/css/font-awesome.all.min.css
./code/Magezon/Core/view/base/web/css/fontawesome5.css
./code/Magezon/Core/view/base/web/css/font-awesome.min.css
./code/Magezon/Core/view/base/web/webfonts/fa-brands-400.svg
./code/Magezon/Core/view/base/web/webfonts/fa-brands-400.eot
./code/Magezon/Core/view/base/web/webfonts/fa-brands-400.ttf
For openiconic
app$ grep -rlw "openiconic" .
./code/Magezon/Builder/etc/di.xml
./code/Magezon/Builder/i18n/en_US.csv
./code/Magezon/Builder/view/adminhtml/layout/mgzbuilder.xml
./code/Magezon/Builder/view/frontend/layout/default.xml
Hi @shehzadatn ,
Please refer below link which can help you to add or remove static or external js and css from your custom module.
https://bsscommerce.com/confluence/magento-2-static-resources-javascript-css-fonts/
Hope it helps!
Thanks
I will try it out and let you know if it works. Thanks for the reply.