fix(rust-binary-locator): use import.meta.resolve and url.fileURLToPath to locate bundled Rust binary in ESM environments
This commit is contained in:
@@ -108,7 +108,8 @@ export class RustBinaryLocator {
|
||||
const packageName = `${platformPackagePrefix}-${platform}-${arch}`;
|
||||
|
||||
try {
|
||||
const packagePath = require.resolve(`${packageName}/${binaryName}`);
|
||||
const resolved = import.meta.resolve(`${packageName}/${binaryName}`);
|
||||
const packagePath = plugins.url.fileURLToPath(resolved);
|
||||
if (await this.isExecutable(packagePath)) {
|
||||
return packagePath;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user