Skip to content

Magento2.4.6: why Js files are not removing from homepage using layout?

I’m using Porto Theme as parent theme and in my child theme I’m using
layout to remove any unused JS and CSS from different pages. But I’m stuck at JS which is not removed anywhere on any page. this is the code and attached a screenshot of the network tab.

app/design/frontend/vendor/module/Magento_Theme/layout/cms_index_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <remove src="Magento_Theme::js/inputMask.js"/>
        <remove src="mage/calendar.css"/>
    </head>
</page>

enter image description here

whats the reason, why its not getting removed?