I have enabled js and css merging and bundling from the configuration.
we can remove particular js or css using below code.
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<remove src="name.css"/>
<remove src="js/name.js"/>
<remove src="Vendor_Module::js/name.js"/>
</head>
</page>
But when i try same for removing merged js or css file it is not working,
is there any other way to remove that merged css and js files from layout or any other way.
Best Answer
Exclude js file from the bundle by adding the js file in Theme_Directory/etc/view.xml
Exclude js file from minification in config.xml
You have not excluded the files but you have removed them.
So to exclude the files specified by you from merging/bundling you can add those files to exclude list in your Theme_Directory/etc/view.xml so that they can be loaded individually
So if you have minified your files please specify the file name as
css/name.min.css
orjs/name.min.js
I have enabled minification and merge in Magento 2.3.1 and I have excluded this file which is loading separately rather than merge file