webpack/test/configCases/loaders/resolve/loader.js

11 lines
317 B
JavaScript
Raw Normal View History

2025-08-21 22:13:36 +08:00
const path = require("path");
/** @type {import("../../../../").LoaderDefinition} */
module.exports = function () {
const callback = this.async();
2025-08-22 00:14:29 +08:00
this.resolve(this.context, "./b.js", (err, result) => {
callback(err, `module.exports = ${JSON.stringify(path.basename(/** @type {string} */ (result)))};`)
2025-08-21 22:13:36 +08:00
});
};