On this page

Tracks the symbols and cross-module references needed while rendering a concatenated module.

new ConcatenationScope(modulesMap, currentModule, usedNames): ConcatenationScope
Attributes
modulesMap:ModuleInfo[] | Map<Module, ModuleInfo>
all module info by module
the current module info
usedNames:Set<string>
all used names

Creates the mutable scope object used while rendering a concatenated module and its cross-module references.

Attributes
usedNames:Set<string>
DEFAULT_EXPORT:string
NAMESPACE_OBJECT_EXPORT:string
createModuleReference(module, partial): string
Attributes
module:Module
the referenced module
partial:Partial<ModuleReferenceOptions>
Returns:string
the reference as identifier

Encodes a reference to another concatenated module as a placeholder identifier that can be parsed later during code generation.


getRawExport(exportName): string | undefined
Attributes
exportName:string
name of the export
Returns:string | undefined
the expression of the export

Returns the raw expression registered for an export, if one exists.


isModuleInScope(module): boolean
Attributes
module:Module
the referenced module
Returns:boolean
true, when it's in the scope

Checks whether a module participates in the current concatenation scope.


registerExport(exportName, symbol): void
Attributes
exportName:string
name of the export
symbol:string
identifier of the export in source code
Returns:void

Records the symbol that should be used when the current module exports a named binding.


registerNamespaceExport(symbol): void
Attributes
symbol:string
identifier of the export in source code
Returns:void

Records the symbol that should be used for the synthetic namespace export.


registerRawExport(exportName, expression): void
Attributes
exportName:string
name of the export
expression:string
expression to be used
Returns:void

Records a raw expression that can be used to reference an export without going through the normal symbol map.


setRawExportMap(exportName, expression): void
Attributes
exportName:string
name of the export
expression:string
expression to be used
Returns:void

Replaces the raw expression for an export only when that export already has an entry in the raw export map.


Attributes
name:string
the identifier
Returns:boolean
true, when it's an module reference

Checks whether an identifier is one of webpack's encoded concatenation module references.


Attributes
name:string
the identifier
Returns:ModuleReferenceOptions & { index: number } | null
parsed options and index

Parses an encoded module reference back into its module index and reference flags.

Attributes
ast:Program
concatenationScope:ConcatenationScope
exportMap:Map<string, string>
globalScope:Scope
index:number
internalNames:Map<string, string>
internalSource:Source
interopDefaultAccessName:string
runtime namespace object that detects "__esModule"
interopDefaultAccessUsed:boolean
runtime namespace object that detects "__esModule"
interopNamespaceObject2Name:string
"default-only" namespace
interopNamespaceObject2Used:boolean
"default-only" namespace
interopNamespaceObjectName:string
"default-with-named" namespace
interopNamespaceObjectUsed:boolean
"default-with-named" namespace
module:Module
moduleScope:Scope
namespaceExportSymbol:string
namespaceObjectName:string
rawExportMap:Map<string, string>
runtimeRequirements:ReadonlySet<string>
type:"concatenated"

Attributes
deferred:boolean
the module is deferred at least once
deferredName:string
deferred module.exports / harmony namespace object
deferredNamespaceObjectName:string
deferred namespace object that being used in a not-analyzable way so it must be materialized
deferredNamespaceObjectUsed:boolean
deferred namespace object that being used in a not-analyzable way so it must be materialized
index:number
interopDefaultAccessName:string
runtime namespace object that detects "__esModule"
interopDefaultAccessUsed:boolean
runtime namespace object that detects "__esModule"
interopNamespaceObject2Name:string
"default-only" namespace
interopNamespaceObject2Used:boolean
"default-only" namespace
interopNamespaceObjectName:string
"default-with-named" namespace
interopNamespaceObjectUsed:boolean
"default-with-named" namespace
module:Module
name:string
module.exports / harmony namespace object
nonDeferAccess:boolean
runtimeCondition:string | boolean | SortableSet<string>
type:"external"


Attributes
asiSafe:boolean
if the position is ASI safe or unknown
call:boolean
true, when this referenced export is called
deferredImport:boolean
true, when this referenced export is deferred
directImport:boolean
true, when this referenced export is directly imported (not via property access)
ids:string[]
the properties or exports selected from the referenced module

Type:Program | ImportDeclaration | ExportNamedDeclaration | ExportAllDeclaration | ImportExpressionImport | UnaryExpression | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ClassExpression | ConditionalExpression | FunctionExpression | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UpdateExpression | YieldExpression | SpreadElement | PrivateIdentifier | Super | FunctionDeclaration | VariableDeclaration | ClassDeclaration | ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | ExportDefaultDeclaration | MethodDefinition | PropertyDefinition | VariableDeclarator | AssignmentProperty | Property | CatchClause | ClassBody | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | SwitchCase | TemplateElement

Attributes
from:Scope
identifier:Identifier
init:boolean
isRead:() => boolean
isReadOnly:() => boolean
isReadWrite:() => boolean
isWrite:() => boolean
isWriteOnly:() => boolean
resolved:Variable | null
writeExpr:Program | AssignmentProperty | Property | CatchClause | ClassDeclaration | ClassExpression | ClassBody | Identifier | SimpleLiteral | RegExpLiteral | BigIntLiteral | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | SimpleCallExpression | NewExpression | ChainExpression | ConditionalExpression | FunctionExpression | ImportExpression | LogicalExpression | MemberExpression | MetaProperty | ObjectExpression | SequenceExpression | TaggedTemplateExpression | TemplateLiteral | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | FunctionDeclaration | MethodDefinition | ImportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | PrivateIdentifier | PropertyDefinition | SpreadElement | ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | VariableDeclaration | Super | SwitchCase | TemplateElement | VariableDeclarator | null

Attributes
childScopes:Scope[]
functionExpressionScope:boolean
implicit:{ set: Map<string, Variable>; variables: Variable[] }
isStrict:boolean
references:Reference[]
through:Reference[]
type:"function" | "module" | "with" | "global" | "catch" | "class" | "for" | "switch" | "block" | "class-field-initializer" | "class-static-block" | "function-expression-name" | "TDZ"
upper:Scope | null
variables:Variable[]
variableScope:Scope

Attributes
defs:any[]
identifiers:Identifier[]
name:string
references:Reference[]
scope:Scope