本文整理了Java中com.google.javascript.jscomp.Compiler.getModuleGraph()
方法的一些代码示例,展示了Compiler.getModuleGraph()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Compiler.getModuleGraph()
方法的具体详情如下:
包路径:com.google.javascript.jscomp.Compiler
类名称:Compiler
方法名:getModuleGraph
[英]Gets the graph of JS source modules.
Returns null if #init or #initModules hasn't been called yet. Otherwise, the result is always a module graph, even in the degenerate case where there's only one module.
[中]获取JS源模块的图形。
如果尚未调用#init或#initModules,则返回null。否则,结果总是一个模图,即使在只有一个模的退化情况下也是如此。
代码示例来源:origin: org.scala-js/closure-compiler-java-6
/**
* Creates a record function information compiler pass.
*
* @param compiler The JSCompiler
* @param functionNames Assigned function identifiers.
*/
RecordFunctionInformation(Compiler compiler,
FunctionNames functionNames) {
this.compiler = compiler;
this.moduleGraph = compiler.getModuleGraph();
this.functionNames = functionNames;
this.mapBuilder = FunctionInformationMap.newBuilder();
}
代码示例来源:origin: com.google.javascript/closure-compiler
/** Prints the current module graph as JSON. */
@VisibleForTesting
@GwtIncompatible("Unnecessary")
void printModuleGraphJsonTo(Appendable out) throws IOException {
out.append(compiler.getModuleGraph().toJson().toString());
}
代码示例来源:origin: com.google.javascript/closure-compiler
@VisibleForTesting
@GwtIncompatible("Unnecessary")
void writeModuleOutput(Appendable out, JSModule m) throws IOException {
if (parsedModuleWrappers == null) {
parsedModuleWrappers =
parseModuleWrappers(
config.moduleWrapper,
ImmutableList.copyOf(compiler.getModuleGraph().getAllModules()));
}
String fileName = getModuleOutputFileName(m);
String baseName = new File(fileName).getName();
writeOutput(out, compiler, m,
parsedModuleWrappers.get(m.getName()).replace("%basename%", baseName),
"%s", null);
}
代码示例来源:origin: com.google.javascript/closure-compiler
Iterable<JSModule> modules = compiler.getModuleGraph().getAllModules();
for (JSModule module : modules) {
try (Writer out = fileNameToOutputWriter2(expandCommandLinePath(output, module))) {
printModuleGraphManifestOrBundleTo(compiler.getModuleGraph(), out, isManifest);
内容来源于网络,如有侵权,请联系作者删除!