Class ModuleLoader
java.lang.Object
com.google.javascript.jscomp.deps.ModuleLoader
Provides compile-time locate semantics for ES6 and CommonJS modules.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Builderclass
A path to a module.static interface
An enum used to specify what algorithm to use to locate non path-based modulesstatic enum
Indicates whether to escape characters in paths.static enum
An enum indicating whether to absolutize paths.static enum
Standard path base resolution algorithms that are accepted as a command line flag. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The default module root, the current directory.static final ModuleLoader
A trivial module loader with no roots.static final DiagnosticType
static final String
static final DiagnosticType
static final DiagnosticType
static final String
According to the spec, the forward slash should be the delimiter on all platforms. -
Method Summary
Modifier and TypeMethodDescriptionstatic ModuleLoader.Builder
builder()
static boolean
isAbsoluteIdentifier
(String name) Whether this is absolute to the compilation.static boolean
isAmbiguousIdentifier
(String name) Whether this is neither absolute or relative.static boolean
isPathIdentifier
(String name) Whether name is a path-based identifier (has a '/' character)static boolean
isRelativeIdentifier
(String name) Whether this is relative to the current file, or a top-level identifier.static String
relativePathFrom
(String fromUriPath, String toUriPath) Resolves a path into aModuleLoader.ModulePath
.void
setErrorHandler
(ErrorHandler errorHandler)
-
Field Details
-
MODULE_CONFLICT
-
MODULE_SLASH
According to the spec, the forward slash should be the delimiter on all platforms.- See Also:
-
DEFAULT_FILENAME_PREFIX
The default module root, the current directory.- See Also:
-
JSC_BROWSER_SKIPLISTED_MARKER
- See Also:
-
LOAD_WARNING
-
INVALID_MODULE_PATH
-
EMPTY
A trivial module loader with no roots.
-
-
Method Details
-
builder
-
getPackageJsonMainEntries
-
resolve
Resolves a path into aModuleLoader.ModulePath
. -
isRelativeIdentifier
Whether this is relative to the current file, or a top-level identifier. -
isAbsoluteIdentifier
Whether this is absolute to the compilation. -
isAmbiguousIdentifier
Whether this is neither absolute or relative. -
isPathIdentifier
Whether name is a path-based identifier (has a '/' character) -
relativePathFrom
-
setErrorHandler
-
getErrorHandler
-