Class BaseTranspiler.CompilerSupplier

java.lang.Object
com.google.javascript.jscomp.transpile.BaseTranspiler.CompilerSupplier
Enclosing class:
BaseTranspiler

public static class BaseTranspiler.CompilerSupplier extends Object
Wraps the Compiler into a more relevant interface, making it easy to test the Transpiler without depending on implementation details of the Compiler itself. Also works around the fact that the Compiler is not thread-safe (since we may do multiple transpiles concurrently), so we supply a fresh instance each time when we're in single-file mode.
  • Field Details

    • moduleResolution

      protected final ModuleLoader.ResolutionMode moduleResolution
    • moduleRoots

      protected final com.google.common.collect.ImmutableList<String> moduleRoots
    • prefixReplacements

      protected final com.google.common.collect.ImmutableMap<String,String> prefixReplacements
    • outputFeatureSet

      protected final FeatureSet outputFeatureSet
  • Constructor Details

    • CompilerSupplier

      public CompilerSupplier()
    • CompilerSupplier

      public CompilerSupplier(FeatureSet outputFeatureSet)
    • CompilerSupplier

      public CompilerSupplier(FeatureSet outputFeatureSet, ModuleLoader.ResolutionMode moduleResolution, com.google.common.collect.ImmutableList<String> moduleRoots, com.google.common.collect.ImmutableMap<String,String> prefixReplacements)
      Accepts commonly overridden options for ES6 modules to avoid needed to subclass.
      Parameters:
      moduleResolution - module resolution for resolving import paths
      prefixReplacements - prefix replacements for when moduleResolution is ModuleLoader.ResolutionMode.BROWSER_WITH_TRANSFORMED_PREFIXES
  • Method Details