Description
As described in https://github.com/l0rdn1kk0n/wicket-bootstrap/issues/409#issuecomment-48505042 :
Add
@Override protected ResourceReferenceRegistry newResourceReferenceRegistry() { return new LessAwareRR(super.newResourceReferenceRegistry()); } private static class LessAwareRR extends ResourceReferenceRegistry { private final ResourceReferenceRegistry delegate; private LessAwareRR(ResourceReferenceRegistry delegate) { this.delegate = delegate; } @Override protected ResourceReference createDefaultResourceReference(ResourceReference.Key key) { if (key.getName().endsWith(".less")) { return new LessResourceReference(key); } return super.createDefaultResourceReference(key); } }
to WicketApplication.java and it starts to work as desired.
Another way to do the same is:
@Override protected ResourceReferenceRegistry newResourceReferenceRegistry() { return new ResourceReferenceRegistry(new LessRRFactory()); } private static class LessRRFactory extends ResourceReferenceRegistry.DefaultResourceReferenceFactory { @Override public ResourceReference create(ResourceReference.Key key) { if (key.getName().endsWith(".less")) { return new LessResourceReference(key); } else { return super.create(key); } } }
Unfortunately at the moment there is no way to do this automatically with de.agilecoders.wicket.less.BootstrapLess#install(Appllication).
Attachments
Issue Links
- links to