On this page

class webpack.dependencies.HarmonyImportDependency extends ModuleDependency
new HarmonyImportDependency(request, sourceOrder, phase?, attributes?): HarmonyImportDependency
Attributes
request:<string>
request string
sourceOrder:<number>
source order
phase:
<0> | <2> | <1> import phase
attributes:
<Record> < <string> , <string> > import attributes

Creates an instance of HarmonyImportDependency.

  • attributes <Record><<string>, <string>>
  • category <string> Returns a dependency category, typical categories are "commonjs", "amd", "esm".
  • disconnect <any>
  • loc <DependencyLocation> Returns location.
  • module <any>
  • optional <boolean>
  • phase <ImportPhaseType>
  • range {[number, number]}
  • request <string>
  • sourceOrder <number>
  • type <string> Returns a display name for the type of dependency.
  • userRequest <string>
  • weak <boolean>
  • ExportPresenceModes {{ AUTO: ExportPresenceMode; ERROR: ExportPresenceMode; NONE: ExportPresenceMode; WARN: ExportPresenceMode; fromUserOption: any; resolveFromOptions: any }}
  • EXPORTS_OBJECT_REFERENCED {string[][]}
  • getNonOptionalPart (members: <string>[], membersOptionals: <boolean>[]) => <string>[] Get the non-optional leading part of a member chain.
  • NO_EXPORTS_REFERENCED {string[][]}
  • Template {typeof HarmonyImportDependencyTemplate}
  • TRANSITIVE <symbol> Defines the referenced export type used by this module.
canConcatenate(): boolean
Returns:<boolean>
true if this dependency can be concatenated

Returns true if this dependency can be concatenated


couldAffectReferencingModule(): boolean | symbol

Could affect referencing module.


createIgnoredModule(context): Module
Attributes
context:<string>
Returns:<Module>

Creates an ignored module.


deserialize(objectDeserializerContext): void
Attributes
objectDeserializerContext:<ObjectDeserializerContext>
Returns:<void>

Restores this instance from the provided deserializer context.


getCondition(moduleGraph): false
Attributes
moduleGraph:<ModuleGraph>
Returns:
<false> | (moduleGraphConnection: <ModuleGraphConnection> , runtime: <RuntimeSpec> ) => <ConnectionState> | <null>

Returns function to determine if the connection is active.


getContext(): string | undefined

Returns a request context.


getErrors(moduleGraph): WebpackError
Attributes

Returns errors.


getExports(moduleGraph): ExportsSpec | undefined
Attributes

Returns the exported names


getImportStatement(update, dependencyTemplateContext): [string, string]
Attributes
update:<boolean>
create new variables or update existing one
dependencyTemplateContext:<DependencyTemplateContext>
Returns:
{[string, string]} the import statement and the compat statement

Gets import statement.


getImportVar(moduleGraph): string
Attributes
moduleGraph:<ModuleGraph>
the module graph
Returns:<string>
name of the variable for the import

Returns name of the variable for the import.


getLinkingErrors(moduleGraph, ids, additionalMessage): WebpackError
Attributes
moduleGraph:<ModuleGraph>
module graph
[] imported ids
additionalMessage:<string>
extra info included in the error message
[] | <undefined> errors

Gets linking errors.


getModuleEvaluationSideEffectsState(moduleGraph): ConnectionState
Attributes
moduleGraph:<ModuleGraph>

Gets module evaluation side effects state.


getModuleExports(dependencyTemplateContext): string
Attributes
dependencyTemplateContext:<DependencyTemplateContext>
Returns:<string>
the expression

Gets module exports.


getNumberOfIdOccurrences(): number
Returns:<number>

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


getReference(moduleGraph): never
Stability: 0Deprecated
Attributes
moduleGraph:<ModuleGraph>
Returns:
{never}

Returns the referenced module and export


getReferencedExports(moduleGraph, runtime): (string[] | ReferencedExport)[]
Attributes
moduleGraph:<ModuleGraph>
module graph
the runtime for which the module is analysed
Returns:
{(string[] | ReferencedExport)[]} referenced exports

Returns list of exports referenced by this dependency


getResourceIdentifier(): string | null
Returns:<string> | <null>
an identifier to merge equal requests

Returns an identifier to merge equal requests.


getWarnings(moduleGraph): WebpackError
Attributes

Returns warnings.


serialize(objectSerializerContext): void
Attributes
objectSerializerContext:<ObjectSerializerContext>
Returns:<void>

Serializes this instance into the provided serializer context.


setLoc(startLine, startColumn, endLine, endColumn): void
Attributes
startLine:<number>
startColumn:<number>
endLine:<number>
endColumn:<number>
Returns:<void>

Updates loc using the provided start line.


updateHash(hash, context): void
Attributes

Updates the hash with the data contributed by this instance.


Attributes
dependency:<Dependency>
Returns:<boolean>
true if this dependency can be concatenated

Returns true if this dependency can be concatenated


Attributes
dependency:<Dependency>
Returns:<boolean>

Returns true if the dependency is a low priority dependency.