WXL
3 天以前 3bd962a6d7f61239c020e2dbbeb7341e5b842dd1
node_modules/webpack/lib/node/NodeTargetPlugin.js
@@ -74,19 +74,29 @@
class NodeTargetPlugin {
   /**
    * Creates an instance of NodeTargetPlugin.
    * @param {ExternalsType} type default external type
    */
   constructor(type = "node-commonjs") {
      /** @type {ExternalsType} */
      this.type = type;
   }
   /**
    * Apply the plugin
    * Applies the plugin by registering its hooks on the compiler.
    * @param {Compiler} compiler the compiler instance
    * @returns {void}
    */
   apply(compiler) {
      new ExternalsPlugin(this.type, builtins).apply(compiler);
      new ExternalsPlugin((dependency) => {
         // When `require` node.js built-in modules with module output
         // we should still emit `createRequire` for compatibility
         if (dependency.category === "commonjs") {
            return "node-commonjs";
         }
         return this.type;
      }, builtins).apply(compiler);
   }
}