class ContextElementDependency extends ModuleDependency
new ContextElementDependency(request, sourceOrder?): ContextElementDependency
Creates an instance of ModuleDependency.
Source Code: lib/dependencies/ContextElementDependency.js#L58DependencyLocationReturns location.
anybooleanstringnumberstringbooleanstring[][]string[][]"*""id""local""@"string[][]typeof DependencyTemplatesymbolstringReturns a dependency category, typical categories are "commonjs", "amd", "esm".
anystringReturns a display name for the type of dependency.
contextElementDependency.canConcatenate(): boolean
booleanReturns true if this dependency can be concatenated
contextElementDependency.couldAffectReferencingModule(): boolean | symbol
Could affect referencing module.
contextElementDependency.createIgnoredModule(context): Module
Creates an ignored module.
contextElementDependency.deserialize(__namedParameters): void
ObjectDeserializerContextObjectMiddlewareObject_4Restores this instance from the provided deserializer context.
contextElementDependency.getCondition(moduleGraph): false | ((moduleGraphConnection: ModuleGraphConnection, runtime: RuntimeSpec) => ConnectionState) | null
ModuleGraphfalse | ((moduleGraphConnection: ModuleGraphConnection, runtime: RuntimeSpec) => ConnectionState) | nullReturns function to determine if the connection is active.
contextElementDependency.getContext(): string | undefined
Returns a request context.
contextElementDependency.getErrors(moduleGraph): WebpackError[] | null | undefined
ModuleGraphWebpackError[] | null | undefinedReturns errors.
contextElementDependency.getExports(moduleGraph): ExportsSpec | undefined
ModuleGraphExportsSpec | undefinedReturns the exported names
contextElementDependency.getForwardId(): string | true | null
Returns the export name this dependency requests from its target module (lazy barrel optimization).
contextElementDependency.getLazyName(): string | null
Returns the export name for a LAZY_UNTIL_LOCAL/LAZY_UNTIL_ID classification (lazy barrel optimization).
contextElementDependency.getLazyUntil(): "local" | "id" | "*" | "@" | null
"local" | "id" | "*" | "@" | nullReturns how this dependency may be deferred when its parent module is side-effect-free (lazy barrel optimization).
contextElementDependency.getModuleEvaluationSideEffectsState(moduleGraph): ConnectionState
ModuleGraphConnectionStateGets module evaluation side effects state.
contextElementDependency.getNumberOfIdOccurrences(): number
numberimplement this method to allow the occurrence order plugin to count correctly
contextElementDependency.getReference(moduleGraph): never
ModuleGraphneverReturns the referenced module and export
contextElementDependency.getReferencedExports(moduleGraph, runtime): (string[] | ReferencedExport)[]
Returns list of exports referenced by this dependency
contextElementDependency.getResourceIdentifier(): string | null
Returns an identifier to merge equal requests.
contextElementDependency.getWarnings(moduleGraph): WebpackError[] | null | undefined
ModuleGraphWebpackError[] | null | undefinedReturns warnings.
contextElementDependency.isLazy(): boolean
booleanWhether the lazy barrel currently defers creating this dependency's target module (lazy barrel optimization).
contextElementDependency.serialize(__namedParameters): void
ObjectSerializerContextObjectMiddlewareObject_5Serializes this instance into the provided serializer context.
contextElementDependency.setLazy(value): void
booleanSets whether the lazy barrel defers creating this dependency's target module (lazy barrel optimization).
contextElementDependency.setLoc(startLine, startColumn, endLine, endColumn): void
Updates loc using the provided start line.
contextElementDependency.setLocWithIndex(loc, index): void
numberUpdates loc from a source location plus an explicit index, without
materializing the loc object (keeps get loc lazy). Replaces the
dep.loc = Object.create(loc); dep.loc.index = i pattern, which both
allocated a copy and stored the index outside the serialized fields.
contextElementDependency.updateHash(hash, context): void
HashUpdateHashContextDependencyUpdates the hash with the data contributed by this instance.
ContextElementDependency.canConcatenate(dependency): boolean
DependencybooleanReturns true if the dependency can be concatenated (scope hoisting).
ContextElementDependency.compareLocations(a, b): -1 | 0 | 1
Compares two dependencies by source location for sorting a module's
dependencies, without materializing the loc objects (get loc caches
its result, so comparing through it would retain a location object on every
sorted dependency). These dependencies always carry a real source position,
so only start (line, column) and the within-statement index are compared; a
dependency without an index sorts after one that has an index at the same
position.
ContextElementDependency.isLowPriorityDependency(dependency): boolean
DependencybooleanReturns true if the dependency is a low priority dependency.