我如何在Java中使用闭包编译器

时间:2019-10-18 14:53:34

标签: java

当我在Java中使用闭包编译器时。我使用此文档how to use "closure-compiler " inside the java。但是我无法理解 param:EXTERNS 。最后,我如何从String输入代码?

pom.xml

 <dependency>
    <groupId>com.google.javascript</groupId>
    <artifactId>closure-compiler</artifactId>
    <version>v20190929</version>
  </dependency>

代码

 Compiler  compiler = new Compiler();
 CompilerOptions options = new CompilerOptions();
 CompilationLevel.ADVANCED_OPTIMIZATIONS.setOptionsForCompilationLevel(
                options);
        compiler.compile(source, options);

0 个答案:

没有答案