fix: work around webpack resolution sloppiness

This commit is contained in:
cha0s 2024-02-02 22:50:30 -06:00
parent e4865d8a41
commit 88c4f13f74

View File

@ -49,6 +49,8 @@ module.exports = async function explicate(
if (path !== request) {
const submodules = join(realResolvedCandidate, 'node_modules');
resolver.addModules(submodules);
// Work around webpack-dev-server resolution sloppiness.
resolver.addAlias(join(submodules, 'webpack'), join(resolver.root, 'node_modules', 'webpack'));
// Runtime NODE_PATH hacking.
const {env} = process;
env.NODE_PATH = (env.NODE_PATH || '') + delimiter + submodules;