12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- "use strict";
- module.exports = class ModulesInRootPlugin {
-
- constructor(source, path, target) {
- this.source = source;
- this.path = path;
- this.target = target;
- }
-
- apply(resolver) {
- const target = resolver.ensureHook(this.target);
- resolver
- .getHook(this.source)
- .tapAsync("ModulesInRootPlugin", (request, resolveContext, callback) => {
-
- const obj = {
- ...request,
- path: this.path,
- request: "./" + request.request,
- module: false
- };
- resolver.doResolve(
- target,
- obj,
- "looking for modules in " + this.path,
- resolveContext,
- callback
- );
- });
- }
- };
|