| | |
| | | |
| | | /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */ |
| | | /** @typedef {import("../Dependency")} Dependency */ |
| | | /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */ |
| | | /** @typedef {import("../DependencyTemplate").CssDependencyTemplateContext} DependencyTemplateContext */ |
| | | /** @typedef {import("../css/CssParser").Range} Range */ |
| | | /** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */ |
| | | /** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * Returns an identifier to merge equal requests. |
| | | * @returns {string | null} an identifier to merge equal requests |
| | | */ |
| | | getResourceIdentifier() { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 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) { |
| | |
| | | ModuleDependency.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 |
| | | * @returns {void} |
| | | */ |
| | | apply(dependency, source, templateContext) { |
| | | if (templateContext.type === "javascript") return; |
| | | const dep = /** @type {CssImportDependency} */ (dependency); |
| | | |
| | | source.replace(dep.range[0], dep.range[1] - 1, ""); |