Closed martypitt closed 11 years ago
Currently, configuration is a bit naff:
@Component public class BakehouseConfig implements InitializingBean { @Autowired private ResourceCache resourceCache; @Autowired private FileManager fileRepository; @Override public void afterPropertiesSet() throws Exception { resourceCache.addConfiguration("javascript", new ConcatenateResourcesProcessor("AppCode.js",fileRepository) ); resourceCache.addConfiguration("typescript", new TypescriptProcessor("TypescriptCode.js", fileRepository) ); } }
I'd rather use a DSL here ... something along the lines of:
@Configuration @Profile("Production") public class ProposedBakehouseConfig { @Bean public BakehouseConfig build(BakehouseBuilder builder) { builder .process("javascript").concatenate() .process("typescript").with(new TypescriptProcessor()) .serveResourcesFromCdn(); } }
Currently, configuration is a bit naff:
I'd rather use a DSL here ... something along the lines of: