fix: replace backslashes with forward slashes from resolved pa… (#11366)
* fix: replace backslashes with forward slashes from resolved path for windows environments * add test for resolveAbsoluteRuntime under windows
This commit is contained in:
@@ -10,9 +10,9 @@ import { typeAnnotationToString } from "./helpers";
|
||||
|
||||
function resolveAbsoluteRuntime(moduleName: string, dirname: string) {
|
||||
try {
|
||||
return path.dirname(
|
||||
resolve.sync(`${moduleName}/package.json`, { basedir: dirname }),
|
||||
);
|
||||
return path
|
||||
.dirname(resolve.sync(`${moduleName}/package.json`, { basedir: dirname }))
|
||||
.replace(/\\/g, "/");
|
||||
} catch (err) {
|
||||
if (err.code !== "MODULE_NOT_FOUND") throw err;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user