| | |
| | | /** @typedef {import("./util/runtime").RuntimeSpec} RuntimeSpec */ |
| | | /** @typedef {import("./dependencies/ModuleDependency")} ModuleDependency */ |
| | | /** |
| | | * Defines the update hash context type used by this module. |
| | | * @typedef {object} UpdateHashContext |
| | | * @property {ChunkGraph} chunkGraph |
| | | * @property {RuntimeSpec} runtime |
| | |
| | | */ |
| | | |
| | | /** |
| | | * Defines the source position type used by this module. |
| | | * @typedef {object} SourcePosition |
| | | * @property {number} line |
| | | * @property {number=} column |
| | | */ |
| | | |
| | | /** |
| | | * Defines the real dependency location type used by this module. |
| | | * @typedef {object} RealDependencyLocation |
| | | * @property {SourcePosition} start |
| | | * @property {SourcePosition=} end |
| | |
| | | */ |
| | | |
| | | /** |
| | | * Defines the synthetic dependency location type used by this module. |
| | | * @typedef {object} SyntheticDependencyLocation |
| | | * @property {string} name |
| | | * @property {number=} index |
| | |
| | | |
| | | /** @typedef {SyntheticDependencyLocation | RealDependencyLocation} DependencyLocation */ |
| | | |
| | | /** @typedef {string} ExportInfoName */ |
| | | |
| | | /** |
| | | * Defines the export spec type used by this module. |
| | | * @typedef {object} ExportSpec |
| | | * @property {string} name the name of the export |
| | | * @property {ExportInfoName} name the name of the export |
| | | * @property {boolean=} canMangle can the export be renamed (defaults to true) |
| | | * @property {boolean=} terminalBinding is the export a terminal binding that should be checked for export star conflicts |
| | | * @property {(string | ExportSpec)[]=} exports nested exports |
| | |
| | | /** @typedef {Set<string>} ExportsSpecExcludeExports */ |
| | | |
| | | /** |
| | | * Defines the exports spec type used by this module. |
| | | * @typedef {object} ExportsSpec |
| | | * @property {(string | ExportSpec)[] | true | null} exports exported names, true for unknown exports or null for no exports |
| | | * @property {ExportsSpecExcludeExports=} excludeExports when exports = true, list of unaffected exports |
| | |
| | | */ |
| | | |
| | | /** |
| | | * Defines the referenced export type used by this module. |
| | | * @typedef {object} ReferencedExport |
| | | * @property {string[]} name name of the referenced export |
| | | * @property {boolean=} canMangle when false, referenced export can not be mangled, defaults to true |
| | |
| | | |
| | | /** @typedef {(moduleGraphConnection: ModuleGraphConnection, runtime: RuntimeSpec) => ConnectionState} GetConditionFn */ |
| | | |
| | | const TRANSITIVE = Symbol("transitive"); |
| | | const TRANSITIVE = /** @type {symbol} */ (Symbol("transitive")); |
| | | |
| | | const getIgnoredModule = memoize(() => { |
| | | const RawModule = require("./RawModule"); |
| | |
| | | this._locSC = 0; |
| | | this._locEL = 0; |
| | | this._locEC = 0; |
| | | /** @type {undefined | number} */ |
| | | this._locI = undefined; |
| | | /** @type {undefined | string} */ |
| | | this._locN = undefined; |
| | | /** @type {undefined | DependencyLocation} */ |
| | | this._loc = undefined; |
| | | } |
| | | |
| | | /** |
| | | * Returns a display name for the type of dependency. |
| | | * @returns {string} a display name for the type of dependency |
| | | */ |
| | | get type() { |
| | |
| | | } |
| | | |
| | | /** |
| | | * Returns a dependency category, typical categories are "commonjs", "amd", "esm". |
| | | * @returns {string} a dependency category, typical categories are "commonjs", "amd", "esm" |
| | | */ |
| | | get category() { |
| | |
| | | } |
| | | |
| | | /** |
| | | * Returns location. |
| | | * @returns {DependencyLocation} location |
| | | */ |
| | | get loc() { |
| | |
| | | } |
| | | |
| | | /** |
| | | * Updates loc using the provided start line. |
| | | * @param {number} startLine start line |
| | | * @param {number} startColumn start column |
| | | * @param {number} endLine end line |
| | |
| | | } |
| | | |
| | | /** |
| | | * Returns a request context. |
| | | * @returns {string | undefined} a request context |
| | | */ |
| | | getContext() { |
| | |
| | | } |
| | | |
| | | /** |
| | | * Returns an identifier to merge equal requests. |
| | | * @returns {string | null} an identifier to merge equal requests |
| | | */ |
| | | getResourceIdentifier() { |
| | |
| | | } |
| | | |
| | | /** |
| | | * Could affect referencing module. |
| | | * @returns {boolean | TRANSITIVE} true, when changes to the referenced module could affect the referencing module; TRANSITIVE, when changes to the referenced module could affect referencing modules of the referencing module |
| | | */ |
| | | couldAffectReferencingModule() { |
| | |
| | | */ |
| | | getReference(moduleGraph) { |
| | | throw new Error( |
| | | "Dependency.getReference was removed in favor of Dependency.getReferencedExports, ModuleGraph.getModule and ModuleGraph.getConnection().active" |
| | | "Dependency.getReference was removed in favor of Dependency.getReferencedExports, ModuleGraph.getModule, ModuleGraph.getConnection(), and ModuleGraphConnection.getActiveState(runtime)" |
| | | ); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * Returns function to determine if the connection is active. |
| | | * @param {ModuleGraph} moduleGraph module graph |
| | | * @returns {null | false | GetConditionFn} function to determine if the connection is active |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * Returns warnings |
| | | * Returns warnings. |
| | | * @param {ModuleGraph} moduleGraph module graph |
| | | * @returns {WebpackError[] | null | undefined} warnings |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * Returns errors |
| | | * Returns errors. |
| | | * @param {ModuleGraph} moduleGraph module graph |
| | | * @returns {WebpackError[] | null | undefined} errors |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * Update the hash |
| | | * Updates the hash with the data contributed by this instance. |
| | | * @param {Hash} hash hash to be updated |
| | | * @param {UpdateHashContext} context context |
| | | * @returns {void} |
| | |
| | | } |
| | | |
| | | /** |
| | | * Gets module evaluation side effects state. |
| | | * @param {ModuleGraph} moduleGraph the module graph |
| | | * @returns {ConnectionState} how this dependency connects the module to referencing modules |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * Creates an ignored module. |
| | | * @param {string} context context directory |
| | | * @returns {Module} ignored module |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * Serializes this instance into the provided serializer context. |
| | | * @param {ObjectSerializerContext} context context |
| | | */ |
| | | serialize({ write }) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * Restores this instance from the provided deserializer context. |
| | | * @param {ObjectDeserializerContext} context context |
| | | */ |
| | | deserialize({ read }) { |
| | |
| | | // TODO remove in webpack 6 |
| | | Object.defineProperty(Dependency.prototype, "module", { |
| | | /** |
| | | * Returns throws. |
| | | * @deprecated |
| | | * @returns {EXPECTED_ANY} throws |
| | | */ |
| | |
| | | }, |
| | | |
| | | /** |
| | | * Updates module. |
| | | * @deprecated |
| | | * @returns {never} throws |
| | | */ |
| | |
| | | }); |
| | | |
| | | /** |
| | | * Returns true if the dependency is a low priority dependency. |
| | | * @param {Dependency} dependency dep |
| | | * @returns {boolean} true if the dependency is a low priority dependency |
| | | */ |
| | |
| | | // TODO remove in webpack 6 |
| | | Object.defineProperty(Dependency.prototype, "disconnect", { |
| | | /** |
| | | * Returns throws. |
| | | * @deprecated |
| | | * @returns {EXPECTED_ANY} throws |
| | | */ |