Description
The renderers for h:outputScript and h:outputStylesheet assume that library name / resource name cannot be relocated. One possible example could be merge multiple js or css files into a single one, but only on production time. In theory it should be possible to write a custom Resource wrapper and a custom ResourceHandlerWrapper that check if the file was merged and replace the library name / resource name.
The solution is add an additional check, and mark the resource as rendered again but with the returned value of resource.getLibraryName() and resource.getResourceName()