we have defined components clientLibs as cq.authoring.dialog, But these js libs will be loaded for all templates(all projects) while authoring the pages.
Can we restrict them based on template or components as these JS may create issue in other AEM projects?
I tried extraClientLibs but its not working properly..
Is there anyway other then overlaying out-of-box components?
I solved this problem by inserting two lines of HTL code in the component HTML itself. PFA the screenshot:
You need to have a clientLibraryFolder created with this category name:
Now, ONLY wherever you have this component, the JS/CSS files for this component will be loaded.