LessCacheManager cacheManager = new LessCacheManager();
cacheManager.install(app);
IPackageResourceGuard resourceGuard = app.getResourceSettings().getPackageResourceGuard();
if (resourceGuard instanceof SecurePackageResourceGuard) {
SecurePackageResourceGuard securePackageResourceGuard = (SecurePackageResourceGuard) resourceGuard;
securePackageResourceGuard.addPattern("+*.less");
}
ResourceReferenceRegistry resourceReferenceRegistry = app.getResourceReferenceRegistry();
IResourceReferenceFactory delegate = resourceReferenceRegistry.getResourceReferenceFactory();
resourceReferenceRegistry.setResourceReferenceFactory(new LessResourceReferenceFactory(delegate));