fix: resolve paths using require.resolve (#9665)
This commit is contained in:
@@ -420,7 +420,7 @@ export async function loadModuleMigrations(
|
||||
key: provider.id,
|
||||
},
|
||||
resolutionPath: isString(provider.resolve)
|
||||
? provider.resolve
|
||||
? require.resolve(provider.resolve, { paths: [process.cwd()] })
|
||||
: false,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -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`)
|
||||
|
||||
Reference in New Issue
Block a user