WXL
3 天以前 9bce51f651aad297ef9eb6df832bfdaf1de05d84
node_modules/webpack/lib/ids/NamedChunkIdsPlugin.js
@@ -17,6 +17,7 @@
/** @typedef {import("../Compiler")} Compiler */
/**
 * Defines the named chunk ids plugin options type used by this module.
 * @typedef {object} NamedChunkIdsPluginOptions
 * @property {string=} context context
 * @property {string=} delimiter delimiter
@@ -26,15 +27,16 @@
class NamedChunkIdsPlugin {
   /**
    * Creates an instance of NamedChunkIdsPlugin.
    * @param {NamedChunkIdsPluginOptions=} options options
    */
   constructor(options) {
      this.delimiter = (options && options.delimiter) || "-";
      this.context = options && options.context;
   constructor(options = {}) {
      /** @type {NamedChunkIdsPluginOptions} */
      this.options = options;
   }
   /**
    * Apply the plugin
    * Applies the plugin by registering its hooks on the compiler.
    * @param {Compiler} compiler the compiler instance
    * @returns {void}
    */
@@ -43,8 +45,10 @@
         const hashFunction = compilation.outputOptions.hashFunction;
         compilation.hooks.chunkIds.tap(PLUGIN_NAME, (chunks) => {
            const chunkGraph = compilation.chunkGraph;
            const context = this.context ? this.context : compiler.context;
            const delimiter = this.delimiter;
            const context = this.options.context
               ? this.options.context
               : compiler.context;
            const delimiter = this.options.delimiter || "-";
            const unnamedChunks = assignNames(
               [...chunks].filter((chunk) => {