You should take a look at OmniFaces UnmappedResourceHandler
This ResourceHandler implementation allows the developer to map JSF resources on an URL pattern of /javax.faces.resource/* (basically, the value of the ResourceHandler.RESOURCE_IDENTIFIER constant) without the need for an additional FacesServlet prefix or suffix URL pattern in the default produced resource URLs, such as /javax.faces.resource/faces/css/style.css or /javax.faces.resource/css/style.css.xhtml. This resource handler will produce unmapped URLs like /javax.faces.resource/css/style.css. This has the major advantage that the developer don't need the #{resource} EL expression anymore in order to properly reference relative URLs to images in CSS files.
Also , take a look at this Prevent suffix from being added to resources when page loads
You also can point from one js
to other js
/css
with the following approach:
Lets say you want to populate the css
and js
properties of some js object:
css: $(document).find("link[href*='my-third-party-plugin']").attr("href"),
js: $(document).find("script[src*='my-third-party-plugin']").attr("src")