WXL
3 天以前 9bce51f651aad297ef9eb6df832bfdaf1de05d84
node_modules/webpack/lib/library/ExportPropertyLibraryPlugin.js
@@ -8,7 +8,7 @@
const { ConcatSource } = require("webpack-sources");
const { UsageState } = require("../ExportsInfo");
const RuntimeGlobals = require("../RuntimeGlobals");
const propertyAccess = require("../util/propertyAccess");
const { propertyAccess } = require("../util/property");
const { getEntryRuntime } = require("../util/runtime");
const AbstractLibraryPlugin = require("./AbstractLibraryPlugin");
@@ -20,23 +20,31 @@
/** @typedef {import("../Module")} Module */
/** @typedef {import("../Module").RuntimeRequirements} RuntimeRequirements */
/** @typedef {import("../javascript/JavascriptModulesPlugin").StartupRenderContext} StartupRenderContext */
/** @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 export property library plugin parsed type used by this module.
 * @typedef {object} ExportPropertyLibraryPluginParsed
 * @property {LibraryExport=} export
 */
/**
 * Defines the export property library plugin options type used by this module.
 * @typedef {object} ExportPropertyLibraryPluginOptions
 * @property {LibraryType} type
 */
/**
 * Represents the export property library plugin runtime component.
 * @typedef {ExportPropertyLibraryPluginParsed} T
 * @extends {AbstractLibraryPlugin<ExportPropertyLibraryPluginParsed>}
 */
class ExportPropertyLibraryPlugin extends AbstractLibraryPlugin {
   /**
    * Creates an instance of ExportPropertyLibraryPlugin.
    * @param {ExportPropertyLibraryPluginOptions} options options
    */
   constructor({ type }) {
@@ -47,8 +55,9 @@
   }
   /**
    * 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) {
      return {
@@ -57,6 +66,7 @@
   }
   /**
    * Finish entry module.
    * @param {Module} module the exporting entry module
    * @param {string} entryName the name of the entrypoint
    * @param {LibraryContext<T>} libraryContext context
@@ -83,6 +93,7 @@
   }
   /**
    * Processes the provided chunk.
    * @param {Chunk} chunk the chunk
    * @param {RuntimeRequirements} set runtime requirements
    * @param {LibraryContext<T>} libraryContext context
@@ -93,6 +104,7 @@
   }
   /**
    * Renders source with library export.
    * @param {Source} source source
    * @param {Module} module module
    * @param {StartupRenderContext} renderContext render context