Package com.google.javascript.jscomp

Examples of com.google.javascript.jscomp.SourceFile$Builder


  @Override
  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:");
View Full Code Here

TOP

Related Classes of com.google.javascript.jscomp.SourceFile$Builder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.