Skip to content

Commit

Permalink
chore: add comments for configDir and __dirname in require.resolve paths
Browse files Browse the repository at this point in the history
  • Loading branch information
volodymyr-rutskyi committed Jan 7, 2025
1 parent 16f4b71 commit a67fa3d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/core/src/config/config-resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,14 @@ export async function resolvePlugins(
const absolutePluginPath = existsSync(maybeAbsolutePluginPath)
? maybeAbsolutePluginPath
: // For plugins imported from packages specifically
require.resolve(plugin, { paths: [configDir, __dirname] });
require.resolve(plugin, {
paths: [
// Plugins imported from the node_modules in the project directory
configDir,
// Plugins imported from the node_modules in package install directory (for example, npx cache directory)
__dirname,
],
});

if (!pluginsCache.has(absolutePluginPath)) {
let requiredPlugin: ImportedPlugin | undefined;
Expand Down

0 comments on commit a67fa3d

Please sign in to comment.