class ConstDependency extends NullDependency
new ConstDependency(expression, range, runtimeRequirements?): ConstDependency
Creates an instance of ConstDependency.
Source Code: lib/dependencies/ConstDependency.js#L33stringDependencyLocationReturns location.
anybooleanstring[][]string[][]"*""id""local""@"string[][]typeof ConstDependencyTemplatesymbolstringReturns a dependency category, typical categories are "commonjs", "amd", "esm".
anystringReturns a display name for the type of dependency.
constDependency.canConcatenate(): boolean
booleanReturns true if this dependency can be concatenated
constDependency.couldAffectReferencingModule(): boolean | symbol
Could affect referencing module.
constDependency.createIgnoredModule(context): Module
Creates an ignored module.
constDependency.deserialize(__namedParameters): void
ObjectDeserializerContextObjectMiddlewareObject_4Restores this instance from the provided deserializer context.
constDependency.getCondition(moduleGraph): false | ((moduleGraphConnection: ModuleGraphConnection, runtime: RuntimeSpec) => ConnectionState) | null
ModuleGraphfalse | ((moduleGraphConnection: ModuleGraphConnection, runtime: RuntimeSpec) => ConnectionState) | nullReturns function to determine if the connection is active.
constDependency.getContext(): string | undefined
Returns a request context.
constDependency.getErrors(moduleGraph): WebpackError[] | null | undefined
ModuleGraphWebpackError[] | null | undefinedReturns errors.
constDependency.getExports(moduleGraph): ExportsSpec | undefined
ModuleGraphExportsSpec | undefinedReturns the exported names
constDependency.getForwardId(): string | true | null
Returns the export name this dependency requests from its target module (lazy barrel optimization).
constDependency.getLazyName(): string | null
Returns the export name for a LAZY_UNTIL_LOCAL/LAZY_UNTIL_ID classification (lazy barrel optimization).
constDependency.getLazyUntil(): "local" | "id" | "*" | "@" | null
"local" | "id" | "*" | "@" | nullReturns how this dependency may be deferred when its parent module is side-effect-free (lazy barrel optimization).
constDependency.getModuleEvaluationSideEffectsState(moduleGraph): ConnectionState
ModuleGraphConnectionStateGets module evaluation side effects state.
constDependency.getNumberOfIdOccurrences(): number
numberimplement this method to allow the occurrence order plugin to count correctly
constDependency.getReference(moduleGraph): never
ModuleGraphneverReturns the referenced module and export
constDependency.getReferencedExports(moduleGraph, runtime): (string[] | ReferencedExport)[]
Returns list of exports referenced by this dependency
constDependency.getResourceIdentifier(): string | null
Returns an identifier to merge equal requests.
constDependency.getWarnings(moduleGraph): WebpackError[] | null | undefined
ModuleGraphWebpackError[] | null | undefinedReturns warnings.
constDependency.isLazy(): boolean
booleanWhether the lazy barrel currently defers creating this dependency's target module (lazy barrel optimization).
constDependency.serialize(__namedParameters): void
ObjectSerializerContextObjectMiddlewareObject_5Serializes this instance into the provided serializer context.
constDependency.setLazy(value): void
booleanSets whether the lazy barrel defers creating this dependency's target module (lazy barrel optimization).
constDependency.setLoc(startLine, startColumn, endLine, endColumn): void
Updates loc using the provided start line.
constDependency.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.
constDependency.updateHash(hash, context): void
HashUpdateHashContextDependencyUpdates the hash with the data contributed by this instance.
ConstDependency.canConcatenate(dependency): boolean
DependencybooleanReturns true if the dependency can be concatenated (scope hoisting).
ConstDependency.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.
ConstDependency.isLowPriorityDependency(dependency): boolean
DependencybooleanReturns true if the dependency is a low priority dependency.