Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcompiles committed Feb 2, 2021
1 parent d39cbe2 commit 17acae4
Showing 1 changed file with 23 additions and 23 deletions.
Expand Up @@ -13,33 +13,33 @@ var testPlugin = compiler => {
/** @type {any} */ (loaderContext).shouldReplace = shouldReplace;
}
);
compilation.hooks.finishModules.tapAsync("TestPlugin", function (
modules,
callback
) {
const src = resolve(join(__dirname, "a.js"));
compilation.hooks.finishModules.tapAsync(
"TestPlugin",
function (modules, callback) {
const src = resolve(join(__dirname, "a.js"));

/**
*
* @param {any} m test
* @returns {boolean} test
*/
function matcher(m) {
return m.resource && m.resource === src;
}
/**
*
* @param {any} m test
* @returns {boolean} test
*/
function matcher(m) {
return m.resource && m.resource === src;
}

const module = Array.from(modules).find(matcher);
const module = Array.from(modules).find(matcher);

if (!module) {
throw new Error("something went wrong");
}
if (!module) {
throw new Error("something went wrong");
}

shouldReplace = true;
compilation.rebuildModule(module, err => {
shouldReplace = false;
callback(err);
});
});
shouldReplace = true;
compilation.rebuildModule(module, err => {
shouldReplace = false;
callback(err);
});
}
);
});
};

Expand Down

0 comments on commit 17acae4

Please sign in to comment.