| | |
| | | const { UsageState } = require("../ExportsInfo"); |
| | | const ExternalModule = require("../ExternalModule"); |
| | | const Template = require("../Template"); |
| | | const propertyAccess = require("../util/propertyAccess"); |
| | | const { propertyAccess } = require("../util/property"); |
| | | const AbstractLibraryPlugin = require("./AbstractLibraryPlugin"); |
| | | |
| | | /** @typedef {import("webpack-sources").Source} Source */ |
| | |
| | | /** @typedef {import("../../declarations/WebpackOptions").LibraryType} LibraryType */ |
| | | /** @typedef {import("../Chunk")} Chunk */ |
| | | /** @typedef {import("../Compilation").ChunkHashContext} ChunkHashContext */ |
| | | /** @typedef {import("../ExportsInfo").ExportInfoName} ExportInfoName */ |
| | | /** @typedef {import("../javascript/JavascriptModulesPlugin").RenderContext} RenderContext */ |
| | | /** @typedef {import("../util/Hash")} Hash */ |
| | | /** @template T @typedef {import("./AbstractLibraryPlugin").LibraryContext<T>} LibraryContext<T> */ |
| | | /** |
| | | * Defines the shared type used by this module. |
| | | * @template T |
| | | * @typedef {import("./AbstractLibraryPlugin").LibraryContext<T>} LibraryContext<T> |
| | | */ |
| | | |
| | | /** |
| | | * Defines the system library plugin options type used by this module. |
| | | * @typedef {object} SystemLibraryPluginOptions |
| | | * @property {LibraryType} type |
| | | */ |
| | | |
| | | /** |
| | | * Defines the system library plugin parsed type used by this module. |
| | | * @typedef {object} SystemLibraryPluginParsed |
| | | * @property {string} name |
| | | */ |
| | | |
| | | /** |
| | | * Represents the system library plugin runtime component. |
| | | * @typedef {SystemLibraryPluginParsed} T |
| | | * @extends {AbstractLibraryPlugin<SystemLibraryPluginParsed>} |
| | | */ |
| | | class SystemLibraryPlugin extends AbstractLibraryPlugin { |
| | | /** |
| | | * Creates an instance of SystemLibraryPlugin. |
| | | * @param {SystemLibraryPluginOptions} options the plugin options |
| | | */ |
| | | constructor(options) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * Returns preprocess as needed by overriding. |
| | | * @param {LibraryOptions} library normalized library option |
| | | * @returns {T | false} preprocess as needed by overriding |
| | | * @returns {T} preprocess as needed by overriding |
| | | */ |
| | | parseOptions(library) { |
| | | const { name } = library; |
| | |
| | | } |
| | | |
| | | /** |
| | | * Returns source with library export. |
| | | * @param {Source} source source |
| | | * @param {RenderContext} renderContext render context |
| | | * @param {LibraryContext<T>} libraryContext context |
| | |
| | | const otherUnused = |
| | | exportsInfo.otherExportsInfo.getUsed(chunk.runtime) === |
| | | UsageState.Unused; |
| | | /** @type {string[]} */ |
| | | const instructions = []; |
| | | /** @type {ExportInfoName[]} */ |
| | | const handledNames = []; |
| | | for (const exportInfo of exportsInfo.orderedExports) { |
| | | const used = exportInfo.getUsedName( |
| | |
| | | } |
| | | |
| | | /** |
| | | * Processes the provided chunk. |
| | | * @param {Chunk} chunk the chunk |
| | | * @param {Hash} hash hash |
| | | * @param {ChunkHashContext} chunkHashContext chunk hash context |