Skip to content

Instantly share code, notes, and snippets.

@benweidig
Created October 29, 2020 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benweidig/db9d427c01c573b94cc5a492f88f7c39 to your computer and use it in GitHub Desktop.
Save benweidig/db9d427c01c573b94cc5a492f88f7c39 to your computer and use it in GitHub Desktop.
@Contribute(ResourceMinimizer.class)
@Primary
public static void overrideGoogleClosureCompiler(MappedConfiguration<String, ResourceMinimizer> conf,
@Autobuild CustomGoogleClosureMinimizer gcm) {
conf.override("text/javascript", gcm);
}
public class CustomGoogleClosureMinimizer extends GoogleClosureMinimizer {
public CustomGoogleClosureMinimizer(Logger logger,
OperationTracker tracker,
AssetChecksumGenerator checksumGenerator,
Request request,
@Symbol(WebResourcesSymbols.COMPILATION_LEVEL) CompilationLevel compilationLevel) {
super(logger, tracker, checksumGenerator, request, compilationLevel);
}
@Override
protected boolean isEnabled(StreamableResource resource) {
if (resource.getDescription().endsWith("underscore-1.8.3.js")) {
return false;
}
return super.isEnabled(resource);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment