Skip to content

Commit da22d3e

Browse files
committed
fix: relative path calc on Windows #13
1 parent 22b9ed0 commit da22d3e

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ export default function native(options: NativeOptions): Plugin {
9797
return
9898
}
9999

100-
const nativeFilename = path.join(output, source + NativeExt)
101-
const interopFilename = path.join(output, source + InteropExt)
100+
const nativeFilename = path.posix.join(output, source + NativeExt)
101+
const interopFilename = path.posix.join(output, source + InteropExt)
102102

103103
if (!nativesMap.get(source)) {
104104
ensureDir(path.dirname(interopFilename))
@@ -279,7 +279,7 @@ async function forceCopyNativeFilesIfUnbuilt(
279279
.some((file) => fs.existsSync(path.join(nativeOutput, file)))
280280

281281
if (!exists) {
282-
const nativeDest = path.join(nativeNodeModules, nativeName)
282+
const nativeDest = path.posix.join(nativeNodeModules, nativeName)
283283
copy(nativeRoot, nativeDest)
284284

285285
const dependencies = await flatDependencies(nativeRoot)

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export async function getDependenciesNatives(root = process.cwd()): Promise<Map<
6262
for (const dep of deps) {
6363
if (natives.has(dep)) continue
6464

65-
const depPath = path.join(node_modules_path, dep)
65+
const depPath = path.posix.join(node_modules_path, dep)
6666
const nativeFiles = await globNativeFiles(depPath)
6767

6868
if (nativeFiles.length) {

0 commit comments

Comments
 (0)