Skip to content

Commit 25b55da

Browse files
author
Mariusz Pasinski
committed
fix: ensure that module paths use only forward slash (esp. on Windows)
1 parent 63725af commit 25b55da

File tree

1 file changed

+2
-3
lines changed
  • packages/react-native-node-api-modules/src/node/babel-plugin

1 file changed

+2
-3
lines changed

packages/react-native-node-api-modules/src/node/babel-plugin/plugin.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,8 @@ export function replaceWithRequireNodeAddon3(
7979
originalPath: string
8080
) {
8181
const { packageName, relativePath } = determineModuleContext(resolvedPath);
82-
const finalRelPath = relativePath.startsWith("./")
83-
? relativePath
84-
: `./${relativePath}`;
82+
const relPath = relativePath.replaceAll("\\", "/");
83+
const finalRelPath = relPath.startsWith("./") ? relPath : `./${relPath}`;
8584

8685
p.replaceWith(
8786
t.callExpression(

0 commit comments

Comments
 (0)