Describe the bug
When running under Yarn PnP enhanced-resolve will still use the node_modules resolution
To Reproduce
Setup:
mkdir repro && cd repro
yarn init -y
yarn set version berry
yarn add enhanced-resolve@5.4.1 lodash@4.17.20
Code:
import { ResolverFactory, CachedInputFileSystem } from 'enhanced-resolve';
import path from 'path';
import fs from 'fs';
const cachedFS = new CachedInputFileSystem(fs);
const commonResolver = ResolverFactory.createResolver({
fileSystem: cachedFS,
useSyncFileSystemCalls: true,
});
fs.mkdirSync(path.join(__dirname, 'node_modules/lodash'), { recursive: true });
fs.writeFileSync(path.join(__dirname, 'node_modules/lodash/foo.js'), '');
commonResolver.resolveSync({}, __filename, 'lodash/foo');
throw new Error(`Resolve should have failed since lodash/foo doesn't exist`);
Describe the bug
When running under Yarn PnP
enhanced-resolvewill still use thenode_modulesresolutionTo Reproduce
Setup:
Code: