| | |
| | | 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 */ |
| | |
| | | /** @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 |
| | |
| | | */ |
| | | |
| | | /** |
| | | * 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 |
| | |
| | | |
| | | class LoaderPlugin { |
| | | /** |
| | | * Apply the plugin |
| | | * Applies the plugin by registering its hooks on the compiler. |
| | | * @param {Compiler} compiler the compiler instance |
| | | * @returns {void} |
| | | */ |
| | |
| | | ) |
| | | ); |
| | | } |
| | | /** @type {null | RawSourceMap} */ |
| | | let map; |
| | | /** @type {string | Buffer | undefined} */ |
| | | let source; |
| | | if (moduleSource.sourceAndMap) { |
| | | const sourceAndMap = moduleSource.sourceAndMap(); |
| | |
| | | }; |
| | | |
| | | /** |
| | | * 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 |