Enum Class ModuleLoader.ResolutionMode

java.lang.Object
java.lang.Enum<ModuleLoader.ResolutionMode>
com.google.javascript.jscomp.deps.ModuleLoader.ResolutionMode
All Implemented Interfaces:
Serializable, Comparable<ModuleLoader.ResolutionMode>, Constable
Enclosing class:
ModuleLoader

public static enum ModuleLoader.ResolutionMode extends Enum<ModuleLoader.ResolutionMode>
Standard path base resolution algorithms that are accepted as a command line flag.
  • Enum Constant Details

    • BROWSER

      public static final ModuleLoader.ResolutionMode BROWSER
      Mimics the behavior of MS Edge.

      Modules must begin with a "." or "/" character. Modules must include the file extension MS Edge was the only browser to define a module resolution behavior at the time of this writing.

    • BROWSER_WITH_TRANSFORMED_PREFIXES

      public static final ModuleLoader.ResolutionMode BROWSER_WITH_TRANSFORMED_PREFIXES
      A limited superset of BROWSER that transforms some path prefixes.

      For example one could configure this so that "@root/" is replaced with "/my/path/to/project/" within import paths.

    • NODE

      public static final ModuleLoader.ResolutionMode NODE
      Uses the node module resolution algorithm.

      Modules which do not begin with a "." or "/" character are looked up from the appropriate node_modules folder. Includes the ability to require directories and JSON files. Exact match, then ".js", then ".json" file extensions are searched.

    • WEBPACK

      public static final ModuleLoader.ResolutionMode WEBPACK
      Uses a lookup map provided by webpack to locate modules from a numeric id used during import
  • Method Details

    • values

      public static ModuleLoader.ResolutionMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ModuleLoader.ResolutionMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null