On this page

class HarmonyImportDependency extends ModuleDependency
Source Code: lib/dependencies/HarmonyImportDependency.js#L93

Extended by HarmonyExportImportedSpecifierDependency.

new HarmonyImportDependency(request, sourceOrder, phase?, attributes?): HarmonyImportDependency
Source Code: lib/dependencies/HarmonyImportDependency.js#L101
Attributes
request:string
sourceOrder:number
phase:0 | 2 | 1
attributes:Record<string, string>

Creates an instance of HarmonyImportDependency.

Source Code: lib/dependencies/HarmonyImportDependency.js#L111
Type:Record<string, string>
Source Code: lib/Dependency.js#L172

Returns location.

Type:any
Source Code: lib/Dependency.js#L135
Type:boolean
Source Code: lib/dependencies/HarmonyImportDependency.js#L109
Source Code: lib/dependencies/ModuleDependency.js#L33
Type:[number, number]
Source Code: lib/dependencies/ModuleDependency.js#L27
Type:string
Source Code: lib/dependencies/ModuleDependency.js#L31
Type:number
Source Code: lib/dependencies/ModuleDependency.js#L29
Type:string
Source Code: lib/dependencies/ModuleDependency.js#L37
Type:boolean
Type:Object
HarmonyImportDependency.ExportPresenceModes.fromUserOption(str): ExportPresenceMode
Attributes
str:string | false

Returns result.

HarmonyImportDependency.ExportPresenceModes.resolveFromOptions(specificValue, options): ExportPresenceMode
Attributes
specificValue:string | false | undefined

Resolve export presence mode from parser options with a specific key and shared fallbacks.

Type:string[][]
Type:string[][]
HarmonyImportDependency.getNonOptionalPart(members, membersOptionals): string[]
Attributes
members:string[]
membersOptionals:boolean[]
Returns:string[]
Type:"*"
Type:"id"
Type:"local"
Type:"@"
Type:string[][]
Type:symbol
Source Code: lib/Dependency.js#L164
Type:string

Returns a dependency category, typical categories are "commonjs", "amd", "esm".

Type:any
Source Code: lib/Dependency.js#L156
Type:string

Returns a display name for the type of dependency.

harmonyImportDependency.canConcatenate(): boolean
Source Code: lib/Dependency.js#L429
Returns:boolean

Returns true if this dependency can be concatenated

harmonyImportDependency.couldAffectReferencingModule(): boolean | symbol
Source Code: lib/Dependency.js#L290
Returns:boolean | symbol

Could affect referencing module.

harmonyImportDependency.createIgnoredModule(context): Module
Source Code: lib/Dependency.js#L421
Attributes
context:string
Returns:Module

Creates an ignored module.

harmonyImportDependency.deserialize(__namedParameters): void
Source Code: lib/Dependency.js#L451
Attributes

Restores this instance from the provided deserializer context.

harmonyImportDependency.getCondition(moduleGraph): false | ((moduleGraphConnection: ModuleGraphConnection, runtime: RuntimeSpec) => ConnectionState) | null
Source Code: lib/Dependency.js#L360
Attributes
moduleGraph:ModuleGraph
Returns:false | ((moduleGraphConnection: ModuleGraphConnection, runtime: RuntimeSpec) => ConnectionState) | null

Returns function to determine if the connection is active.

harmonyImportDependency.getContext(): string | undefined
Source Code: lib/Dependency.js#L274
Returns:string | undefined

Returns a request context.

harmonyImportDependency.getErrors(moduleGraph): WebpackError[] | null | undefined
Source Code: lib/Dependency.js#L387
Attributes
moduleGraph:ModuleGraph

Returns errors.

harmonyImportDependency.getExports(moduleGraph): ExportsSpec | undefined
Source Code: lib/Dependency.js#L369
Attributes
moduleGraph:ModuleGraph

Returns the exported names

harmonyImportDependency.getForwardId(): string | true | null
Source Code: lib/Dependency.js#L298
Returns:string | true | null

Returns the export name this dependency requests from its target module (lazy barrel optimization).

harmonyImportDependency.getImportStatement(update, __namedParameters): [string, string]
Source Code: lib/dependencies/HarmonyImportDependency.js#L226
Attributes
update:boolean
__namedParameters:DependencyTemplateContext
Returns:[string, string]

Gets import statement.

harmonyImportDependency.getImportVar(moduleGraph): string
Source Code: lib/dependencies/HarmonyImportDependency.js#L175
Attributes
moduleGraph:ModuleGraph
Returns:string

Returns name of the variable for the import.

harmonyImportDependency.getLazyName(): string | null
Source Code: lib/Dependency.js#L315
Returns:string | null

Returns the export name for a LAZY_UNTIL_LOCAL/LAZY_UNTIL_ID classification (lazy barrel optimization).

harmonyImportDependency.getLazyUntil(): "local" | "id" | "*" | "@" | null
Source Code: lib/Dependency.js#L307
Returns:"local" | "id" | "*" | "@" | null

Returns how this dependency may be deferred when its parent module is side-effect-free (lazy barrel optimization).

harmonyImportDependency.getLinkingErrors(moduleGraph, ids, additionalMessage): WebpackError[] | undefined
Source Code: lib/dependencies/HarmonyImportDependency.js#L250
Attributes
moduleGraph:ModuleGraph
ids:string[]
additionalMessage:string

Gets linking errors.

harmonyImportDependency.getModuleEvaluationSideEffectsState(moduleGraph): ConnectionState
Source Code: lib/Dependency.js#L412
Attributes
moduleGraph:ModuleGraph

Gets module evaluation side effects state.

harmonyImportDependency.getModuleExports(__namedParameters): string
Source Code: lib/dependencies/HarmonyImportDependency.js#L206
Attributes
__namedParameters:DependencyTemplateContext
Returns:string

Gets module exports.

harmonyImportDependency.getNumberOfIdOccurrences(): number
Source Code: lib/Dependency.js#L403
Returns:number

implement this method to allow the occurrence order plugin to count correctly

harmonyImportDependency.getReference(moduleGraph): never
Source Code: lib/Dependency.js#L339
Stability: 0Deprecated
Attributes
moduleGraph:ModuleGraph
Returns:never

Returns the referenced module and export

harmonyImportDependency.getReferencedExports(moduleGraph, runtime): (string[] | ReferencedExport)[]
Source Code: lib/Dependency.js#L351
Attributes
moduleGraph:ModuleGraph
runtime:RuntimeSpec
Returns:(string[] | ReferencedExport)[]

Returns list of exports referenced by this dependency

harmonyImportDependency.getResourceIdentifier(): string | null
Source Code: lib/Dependency.js#L282
Returns:string | null

Returns an identifier to merge equal requests.

harmonyImportDependency.getWarnings(moduleGraph): WebpackError[] | null | undefined
Source Code: lib/Dependency.js#L378
Attributes
moduleGraph:ModuleGraph

Returns warnings.

harmonyImportDependency.isLazy(): boolean
Source Code: lib/Dependency.js#L323
Returns:boolean

Whether the lazy barrel currently defers creating this dependency's target module (lazy barrel optimization).

harmonyImportDependency.serialize(__namedParameters): void
Source Code: lib/Dependency.js#L437
Attributes

Serializes this instance into the provided serializer context.

harmonyImportDependency.setLazy(value): void
Source Code: lib/Dependency.js#L331
Attributes
value:boolean

Sets whether the lazy barrel defers creating this dependency's target module (lazy barrel optimization).

harmonyImportDependency.setLoc(startLine, startColumn, endLine, endColumn): void
Source Code: lib/Dependency.js#L224
Attributes
startLine:number
startColumn:number
endLine:number
endColumn:number

Updates loc using the provided start line.

harmonyImportDependency.setLocWithIndex(loc, index): void
Source Code: lib/Dependency.js#L242
Attributes

Updates 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.

harmonyImportDependency.updateHash(hash, context): void
Source Code: lib/Dependency.js#L397
Attributes

Updates the hash with the data contributed by this instance.

HarmonyImportDependency.canConcatenate(dependency): boolean
Source Code: lib/dependencies/HarmonyImportDependency.js#L140
Attributes
dependency:Dependency
Returns:boolean

Returns true if the dependency can be concatenated (scope hoisting).

HarmonyImportDependency.compareLocations(a, b): -1 | 0 | 1
Attributes
Returns:-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.

HarmonyImportDependency.isLowPriorityDependency(dependency): boolean
Attributes
dependency:Dependency
Returns:boolean

Returns true if the dependency is a low priority dependency.