Indeed, that's the last thing I tried and so far is working as expected. This means I have code like this:
if (WCMMode.fromRequest(request) != WCMMode.DISABLED) { %> <cq:includeClientLib categories="company.custom-component-author" /> <% }