Skip to content

Commit

Permalink
fix: support both of process and node:process
Browse files Browse the repository at this point in the history
e.g. This plugin cannot access the package referenced via node:process which is neither a builtin, nor an exposed entry
  • Loading branch information
zouguangxian committed Feb 8, 2024
1 parent 943a9f0 commit 58a7866
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/yarnpkg-core/sources/Configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1261,8 +1261,10 @@ export class Configuration {
const thirdPartyPlugins = new Map<string, Plugin>([]);
if (pluginConfiguration !== null) {
const requireEntries = new Map();
for (const request of builtinModules)
for (const request of builtinModules) {
requireEntries.set(request, () => miscUtils.dynamicRequire(request));
requireEntries.set(`node:${request}`, () => miscUtils.dynamicRequire(`node:${request}`));
}
for (const [request, embedModule] of pluginConfiguration.modules)
requireEntries.set(request, () => embedModule);

Expand Down

0 comments on commit 58a7866

Please sign in to comment.