| | |
| | | /** @typedef {import("../Dependency")} Dependency */ |
| | | /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ |
| | | /** @typedef {import("../javascript/JavascriptParser").Range} Range */ |
| | | /** @typedef {import("../dependencies/ExternalModuleInitFragment").ArrayImportSpecifiers} ArrayImportSpecifiers */ |
| | | /** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ |
| | | /** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ |
| | | |
| | | class ExternalModuleInitFragmentDependency extends NullDependency { |
| | | /** |
| | | * Creates an instance of ExternalModuleInitFragmentDependency. |
| | | * @param {string} module module |
| | | * @param {{ name: string, value: string }[]} importSpecifiers import specifiers |
| | | * @param {ArrayImportSpecifiers} importSpecifiers import specifiers |
| | | * @param {string | undefined} defaultImport default import |
| | | */ |
| | | constructor(module, importSpecifiers, defaultImport) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * @returns {string} hash update |
| | | */ |
| | | _createHashUpdate() { |
| | | return `${this.importedModule}${JSON.stringify(this.specifiers)}${ |
| | | this.default || "null" |
| | | }`; |
| | | } |
| | | |
| | | /** |
| | | * Serializes this instance into the provided serializer context. |
| | | * @param {ObjectSerializerContext} context context |
| | | */ |
| | | serialize(context) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * Restores this instance from the provided deserializer context. |
| | | * @param {ObjectDeserializerContext} context context |
| | | */ |
| | | deserialize(context) { |
| | |
| | | DependencyTemplate |
| | | ) { |
| | | /** |
| | | * Applies the plugin by registering its hooks on the compiler. |
| | | * @param {Dependency} dependency the dependency for which the template should be applied |
| | | * @param {ReplaceSource} source the current replace source which can be modified |
| | | * @param {DependencyTemplateContext} templateContext the context object |