WXL
3 天以前 9bce51f651aad297ef9eb6df832bfdaf1de05d84
node_modules/webpack/lib/dependencies/LoaderPlugin.js
@@ -10,6 +10,7 @@
const LoaderDependency = require("./LoaderDependency");
const LoaderImportDependency = require("./LoaderImportDependency");
/** @typedef {import("webpack-sources").RawSourceMap} RawSourceMap */
/** @typedef {import("../Compilation").DependencyConstructor} DependencyConstructor */
/** @typedef {import("../Compilation").ExecuteModuleExports} ExecuteModuleExports */
/** @typedef {import("../Compilation").ExecuteModuleResult} ExecuteModuleResult */
@@ -18,6 +19,7 @@
/** @typedef {import("../Module").FileSystemDependencies} FileSystemDependencies */
/**
 * Defines the import module callback callback.
 * @callback ImportModuleCallback
 * @param {(Error | null)=} err error object
 * @param {ExecuteModuleExports=} exports exports of the evaluated module
@@ -25,6 +27,7 @@
 */
/**
 * Defines the import module options type used by this module.
 * @typedef {object} ImportModuleOptions
 * @property {string=} layer the target layer
 * @property {string=} publicPath the target public path
@@ -35,7 +38,7 @@
class LoaderPlugin {
   /**
    * Apply the plugin
    * Applies the plugin by registering its hooks on the compiler.
    * @param {Compiler} compiler the compiler instance
    * @returns {void}
    */
@@ -116,7 +119,9 @@
                              )
                           );
                        }
                        /** @type {null | RawSourceMap} */
                        let map;
                        /** @type {string | Buffer | undefined} */
                        let source;
                        if (moduleSource.sourceAndMap) {
                           const sourceAndMap = moduleSource.sourceAndMap();
@@ -159,6 +164,7 @@
               };
               /**
                * Processes the provided request.
                * @param {string} request the request string to load the module from
                * @param {ImportModuleOptions} options options
                * @param {ImportModuleCallback} callback callback returning the exports