WXL
4 天以前 3bd962a6d7f61239c020e2dbbeb7341e5b842dd1
node_modules/webpack/lib/dependencies/CommonJsExportsParserPlugin.js
@@ -8,7 +8,7 @@
const RuntimeGlobals = require("../RuntimeGlobals");
const formatLocation = require("../formatLocation");
const { evaluateToString } = require("../javascript/JavascriptParserHelpers");
const propertyAccess = require("../util/propertyAccess");
const { propertyAccess } = require("../util/property");
const CommonJsExportRequireDependency = require("./CommonJsExportRequireDependency");
const CommonJsExportsDependency = require("./CommonJsExportsDependency");
const CommonJsSelfReferenceDependency = require("./CommonJsSelfReferenceDependency");
@@ -94,6 +94,7 @@
};
/**
 * Parses require call.
 * @param {JavascriptParser} parser the parser
 * @param {Expression} expr expression
 * @returns {{ argument: BasicEvaluatedExpression, ids: ExportInfoName[] } | undefined} parsed call
@@ -132,6 +133,7 @@
class CommonJsExportsParserPlugin {
   /**
    * Creates an instance of CommonJsExportsParserPlugin.
    * @param {ModuleGraph} moduleGraph module graph
    */
   constructor(moduleGraph) {
@@ -139,6 +141,7 @@
   }
   /**
    * Applies the plugin by registering its hooks on the compiler.
    * @param {JavascriptParser} parser the parser
    * @returns {void}
    */
@@ -148,6 +151,7 @@
      };
      /**
       * Checks namespace.
       * @param {boolean} topLevel true, when the export is on top level
       * @param {Members} members members of the export
       * @param {Expression | undefined} valueExpr expression for the value
@@ -164,6 +168,7 @@
         }
      };
      /**
       * Processes the provided reason.
       * @param {string=} reason reason
       */
      const bailout = (reason) => {
@@ -171,6 +176,7 @@
         if (reason) bailoutHint(reason);
      };
      /**
       * Processes the provided reason.
       * @param {string} reason reason
       */
      const bailoutHint = (reason) => {
@@ -190,6 +196,7 @@
      // exporting //
      /**
       * Handle assign export.
       * @param {AssignmentExpression} expr expression
       * @param {CommonJSDependencyBaseKeywords} base commonjs base keywords
       * @param {Members} members members of the export
@@ -313,6 +320,7 @@
      // Self reference //
      /**
       * Handle access export.
       * @param {Expression | Super} expr expression
       * @param {CommonJSDependencyBaseKeywords} base commonjs base keywords
       * @param {Members} members members of the export