0

I want to include my own js or include only a few js in require.js, but need to exclude all js files / css files being loaded default by Magneto or any module.

It is explained here:

https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/xml-manage.html#layout_markup_css

As per the docs, I should include in my:

app/design/frontend///Magento_Theme/layout/default_head_blocks.xml

like:

<remove src="Magento_Catalog::js/compare.js" />

I have done exactly that but it doesn't seem to be working.

but it is working for other instances for example

<remove src="MGS_Mpanel::js/timer.js"/>

This line is removing timer.js

In a nutshell, I want to remove all js (barring few) from my custom theme.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.