WXL
3 天以前 9bce51f651aad297ef9eb6df832bfdaf1de05d84
node_modules/webpack/lib/web/JsonpChunkLoadingPlugin.js
@@ -14,9 +14,15 @@
const PLUGIN_NAME = "JsonpChunkLoadingPlugin";
/**
 * Enables browser-side JavaScript chunk loading through the JSONP runtime and
 * adds the supporting runtime requirements for matching chunks.
 */
class JsonpChunkLoadingPlugin {
   /**
    * Apply the plugin
    * Registers compilation hooks that attach the JSONP chunk-loading runtime
    * module and its dependent runtime globals to chunks using `chunkLoading:
    * "jsonp"`.
    * @param {Compiler} compiler the compiler instance
    * @returns {void}
    */
@@ -24,6 +30,8 @@
      compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {
         const globalChunkLoading = compilation.outputOptions.chunkLoading;
         /**
          * Determines whether the chunk resolves JavaScript chunks through the
          * JSONP loading backend.
          * @param {Chunk} chunk chunk
          * @returns {boolean} true, if wasm loading is enabled for the chunk
          */
@@ -35,8 +43,11 @@
                  : globalChunkLoading;
            return chunkLoading === "jsonp";
         };
         /** @type {WeakSet<Chunk>} */
         const onceForChunkSet = new WeakSet();
         /**
          * Adds the JSONP runtime module to a chunk once, along with the core
          * runtime globals it relies on.
          * @param {Chunk} chunk chunk
          * @param {RuntimeRequirements} set runtime requirements
          */