| | |
| | | /** @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 ExternalModuleDependency extends CachedConstDependency { |
| | | /** |
| | | * Creates an instance of ExternalModuleDependency. |
| | | * @param {string} module module |
| | | * @param {{ name: string, value: string }[]} importSpecifiers import specifiers |
| | | * @param {ArrayImportSpecifiers} importSpecifiers import specifiers |
| | | * @param {string | undefined} defaultImport default import |
| | | * @param {string} expression expression |
| | | * @param {Range} range range |
| | | * @param {Range | null} range range |
| | | * @param {string} identifier identifier |
| | | * @param {number=} place place where we inject the expression |
| | | */ |
| | | constructor( |
| | | module, |
| | |
| | | defaultImport, |
| | | expression, |
| | | range, |
| | | identifier |
| | | identifier, |
| | | place = CachedConstDependency.PLACE_MODULE |
| | | ) { |
| | | super(expression, range, identifier); |
| | | super(expression, range, identifier, place); |
| | | |
| | | this.importedModule = module; |
| | | this.specifiers = importSpecifiers; |
| | |
| | | } |
| | | |
| | | /** |
| | | * Create hash update. |
| | | * @returns {string} hash update |
| | | */ |
| | | _createHashUpdate() { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 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) { |
| | |
| | | CachedConstDependency.Template |
| | | ) { |
| | | /** |
| | | * 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 |