public final class ModuleLoader extends Object
Modifier and Type | Class and Description |
---|---|
class |
ModuleLoader.ModulePath
A path to a module.
|
static class |
ModuleLoader.PathResolver
An enum indicating whether to absolutize paths.
|
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_FILENAME_PREFIX
The default module root, the current directory.
|
static ModuleLoader |
EMPTY
A trivial module loader with no roots.
|
static DiagnosticType |
LOAD_WARNING |
static DiagnosticType |
MODULE_CONFLICT |
static String |
MODULE_SLASH
According to the spec, the forward slash should be the delimiter on all platforms.
|
Constructor and Description |
---|
ModuleLoader(ErrorHandler errorHandler,
Iterable<String> moduleRoots,
Iterable<? extends DependencyInfo> inputs) |
ModuleLoader(ErrorHandler errorHandler,
Iterable<String> moduleRoots,
Iterable<? extends DependencyInfo> inputs,
ModuleLoader.PathResolver pathResolver)
Creates an instance of the module loader which can be used to locate ES6 and CommonJS modules.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
isAbsoluteIdentifier(String name)
Whether this is absolute to the compilation.
|
static boolean |
isRelativeIdentifier(String name)
Whether this is relative to the current file, or a top-level identifier.
|
ModuleLoader.ModulePath |
resolve(String path)
Resolves a path into a
ModuleLoader.ModulePath . |
public static final DiagnosticType MODULE_CONFLICT
public static final String MODULE_SLASH
public static final String DEFAULT_FILENAME_PREFIX
public static final DiagnosticType LOAD_WARNING
public static final ModuleLoader EMPTY
public ModuleLoader(@Nullable ErrorHandler errorHandler, Iterable<String> moduleRoots, Iterable<? extends DependencyInfo> inputs, ModuleLoader.PathResolver pathResolver)
inputs
- All inputs to the compilation process.public ModuleLoader(@Nullable ErrorHandler errorHandler, Iterable<String> moduleRoots, Iterable<? extends DependencyInfo> inputs)
public ModuleLoader.ModulePath resolve(String path)
ModuleLoader.ModulePath
.public static boolean isRelativeIdentifier(String name)
public static boolean isAbsoluteIdentifier(String name)
Copyright © 2009-2016 Google. All Rights Reserved.