public InputStream minify(String name, String type, InputStream stream) throws IOException {
if (type.equals("script")) {
Compiler compiler = new Compiler();
CompilerOptions options = new CompilerOptions();
SourceFile source = SourceFile.fromInputStream(name, stream);
Result result = compiler.compile(Collections.<SourceFile>emptyList(), Collections.singletonList(source), options);
if (result.errors.length > 0) {
StringWriter buffer = new StringWriter();
PrintWriter writer = new PrintWriter(buffer);
writer.println("Malformed asset:");
for (JSError error : result.errors) {