WXL
4 天以前 2cc85c64f1c64a2dbaeae276a3e2ca8420de76b7
node_modules/webpack/lib/RuntimePlugin.js
@@ -111,10 +111,13 @@
   [RuntimeGlobals.shareScopeMap]: [RuntimeGlobals.hasOwnProperty]
};
const FULLHASH_REGEXP = /\[(?:full)?hash(?::\d+)?\]/;
const PLUGIN_NAME = "RuntimePlugin";
class RuntimePlugin {
   /**
    * Applies the plugin by registering its hooks on the compiler.
    * @param {Compiler} compiler the Compiler
    * @returns {void}
    */
@@ -122,6 +125,7 @@
      compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {
         const globalChunkLoading = compilation.outputOptions.chunkLoading;
         /**
          * Checks whether this runtime plugin is chunk loading disabled for chunk.
          * @param {Chunk} chunk chunk
          * @returns {boolean} true, when chunk loading is disabled for the chunk
          */
@@ -266,7 +270,7 @@
                  if (
                     typeof publicPath !== "string" ||
                     /\[(full)?hash\]/.test(publicPath)
                     /\[(?:full)?hash\]/.test(publicPath)
                  ) {
                     module.fullHash = true;
                  }
@@ -314,9 +318,7 @@
            .tap(PLUGIN_NAME, (chunk, set, { chunkGraph }) => {
               if (
                  typeof compilation.outputOptions.chunkFilename === "string" &&
                  /\[(full)?hash(:\d+)?\]/.test(
                     compilation.outputOptions.chunkFilename
                  )
                  FULLHASH_REGEXP.test(compilation.outputOptions.chunkFilename)
               ) {
                  set.add(RuntimeGlobals.getFullHash);
               }
@@ -342,9 +344,7 @@
            .tap(PLUGIN_NAME, (chunk, set, { chunkGraph }) => {
               if (
                  typeof compilation.outputOptions.cssChunkFilename === "string" &&
                  /\[(full)?hash(:\d+)?\]/.test(
                     compilation.outputOptions.cssChunkFilename
                  )
                  FULLHASH_REGEXP.test(compilation.outputOptions.cssChunkFilename)
               ) {
                  set.add(RuntimeGlobals.getFullHash);
               }
@@ -374,7 +374,7 @@
            .for(RuntimeGlobals.getChunkUpdateScriptFilename)
            .tap(PLUGIN_NAME, (chunk, set) => {
               if (
                  /\[(full)?hash(:\d+)?\]/.test(
                  FULLHASH_REGEXP.test(
                     compilation.outputOptions.hotUpdateChunkFilename
                  )
               ) {
@@ -396,7 +396,7 @@
            .for(RuntimeGlobals.getUpdateManifestFilename)
            .tap(PLUGIN_NAME, (chunk, set) => {
               if (
                  /\[(full)?hash(:\d+)?\]/.test(
                  FULLHASH_REGEXP.test(
                     compilation.outputOptions.hotUpdateMainFilename
                  )
               ) {