[79a0317] | 1 | /*
|
---|
| 2 | MIT License http://www.opensource.org/licenses/mit-license.php
|
---|
| 3 | Author Tobias Koppers @sokra
|
---|
| 4 | */
|
---|
| 5 |
|
---|
| 6 | "use strict";
|
---|
| 7 |
|
---|
| 8 | /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */
|
---|
| 9 | /** @typedef {import("./ChunkGraph")} ChunkGraph */
|
---|
| 10 | /** @typedef {import("./CodeGenerationResults")} CodeGenerationResults */
|
---|
| 11 | /** @typedef {import("./ConcatenationScope")} ConcatenationScope */
|
---|
| 12 | /** @typedef {import("./Dependency")} Dependency */
|
---|
| 13 | /** @typedef {import("./Dependency").RuntimeSpec} RuntimeSpec */
|
---|
| 14 | /** @typedef {import("./DependencyTemplates")} DependencyTemplates */
|
---|
| 15 | /** @typedef {import("./Generator").GenerateContext} GenerateContext */
|
---|
| 16 | /** @typedef {import("./Module")} Module */
|
---|
| 17 | /** @typedef {import("./Module").RuntimeRequirements} RuntimeRequirements */
|
---|
| 18 | /** @typedef {import("./ModuleGraph")} ModuleGraph */
|
---|
| 19 | /** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */
|
---|
| 20 |
|
---|
| 21 | /**
|
---|
| 22 | * @template T
|
---|
| 23 | * @typedef {import("./InitFragment")<T>} InitFragment
|
---|
| 24 | */
|
---|
| 25 |
|
---|
| 26 | /**
|
---|
| 27 | * @typedef {object} DependencyTemplateContext
|
---|
| 28 | * @property {RuntimeTemplate} runtimeTemplate the runtime template
|
---|
| 29 | * @property {DependencyTemplates} dependencyTemplates the dependency templates
|
---|
| 30 | * @property {ModuleGraph} moduleGraph the module graph
|
---|
| 31 | * @property {ChunkGraph} chunkGraph the chunk graph
|
---|
| 32 | * @property {RuntimeRequirements} runtimeRequirements the requirements for runtime
|
---|
| 33 | * @property {Module} module current module
|
---|
| 34 | * @property {RuntimeSpec} runtime current runtimes, for which code is generated
|
---|
| 35 | * @property {InitFragment<GenerateContext>[]} initFragments mutable array of init fragments for the current module
|
---|
| 36 | * @property {ConcatenationScope=} concatenationScope when in a concatenated module, information about other concatenated modules
|
---|
| 37 | * @property {CodeGenerationResults} codeGenerationResults the code generation results
|
---|
| 38 | * @property {InitFragment<GenerateContext>[]} chunkInitFragments chunkInitFragments
|
---|
| 39 | */
|
---|
| 40 |
|
---|
| 41 | /**
|
---|
| 42 | * @typedef {object} CssDependencyTemplateContextExtras
|
---|
| 43 | * @property {CssData} cssData the css exports data
|
---|
| 44 | */
|
---|
| 45 |
|
---|
| 46 | /**
|
---|
| 47 | * @typedef {object} CssData
|
---|
| 48 | * @property {boolean} esModule whether export __esModule
|
---|
| 49 | * @property {Map<string, string>} exports the css exports
|
---|
| 50 | */
|
---|
| 51 |
|
---|
| 52 | /** @typedef {DependencyTemplateContext & CssDependencyTemplateContextExtras} CssDependencyTemplateContext */
|
---|
| 53 |
|
---|
| 54 | class DependencyTemplate {
|
---|
| 55 | /* istanbul ignore next */
|
---|
| 56 | /**
|
---|
| 57 | * @abstract
|
---|
| 58 | * @param {Dependency} dependency the dependency for which the template should be applied
|
---|
| 59 | * @param {ReplaceSource} source the current replace source which can be modified
|
---|
| 60 | * @param {DependencyTemplateContext} templateContext the context object
|
---|
| 61 | * @returns {void}
|
---|
| 62 | */
|
---|
| 63 | apply(dependency, source, templateContext) {
|
---|
| 64 | const AbstractMethodError = require("./AbstractMethodError");
|
---|
| 65 | throw new AbstractMethodError();
|
---|
| 66 | }
|
---|
| 67 | }
|
---|
| 68 |
|
---|
| 69 | module.exports = DependencyTemplate;
|
---|