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 classBuilderclassA path to a module.static interfaceAn enum used to specify what algorithm to use to locate non path-based modulesstatic enumIndicates whether to escape characters in paths.static enumAn enum indicating whether to absolutize paths.static enumStandard path base resolution algorithms that are accepted as a command line flag. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default module root, the current directory.static final ModuleLoaderA trivial module loader with no roots.static final DiagnosticTypestatic final Stringstatic final DiagnosticTypestatic final DiagnosticTypestatic final StringAccording to the spec, the forward slash should be the delimiter on all platforms. -
Method Summary
Modifier and TypeMethodDescriptionstatic ModuleLoader.Builderbuilder()static booleanisAbsoluteIdentifier(String name) Whether this is absolute to the compilation.static booleanisAmbiguousIdentifier(String name) Whether this is neither absolute or relative.static booleanisPathIdentifier(String name) Whether name is a path-based identifier (has a '/' character)static booleanisRelativeIdentifier(String name) Whether this is relative to the current file, or a top-level identifier.static StringrelativePathFrom(String fromUriPath, String toUriPath) Resolves a path into aModuleLoader.ModulePath.voidsetErrorHandler(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
-