I am using Sitecore 9.1 and SXA 1.8, I need to clone "component-search-results-count.js" in base theme to extend some functionality to the OOB "Search Result Count" component.
How can I do that?
component-search-results-count.js and add that to my theme, or create a custom base theme.
As for the base theme, I normally make a copy of it, for example, the
Components Theme, then I use my copy as the base theme for my sites theme, instead of the OOTB version. This means I can then remove any files that I override without touching the OOTB base theme.
The reason, I add the files to the theme instead of just modifying the ones in my copy of the base theme, is so that I can easily use Creative Exchange to import the modified files. Creative Exchange does not import any of the files in the base themes.
Of course, you can always just remove the files from the OOTB Base Theme, but then you would have to make sure that you replicate that on each upgrade.