fix: resolve paths using require.resolve (#9665)

This commit is contained in:
Harminder Virk authored and GitHub committed 2024-10-18 13:30:29 +00:00
1 parent d3c1580c06
commit 1e0f6188ec
2 files changed
+4 -2

No files matched your search

@@ -100,7 +100,9 @@ function resolvePlugin(pluginName: string): {
try {
// If the path is absolute, resolve the directory of the internal plugin,
// otherwise resolve the directory containing the package.json
const resolvedPath = require.resolve(pluginName)
const resolvedPath = require.resolve(pluginName, {
paths: [process.cwd()],
})
const packageJSON = JSON.parse(
fs.readFileSync(`${resolvedPath}/package.json`, `utf-8`)