Skip to content

Commit 9d3e5f0

Browse files
authored
Merge pull request #15 from vite-plugin/v2.2.2
V2.2.2
2 parents 22b9ed0 + 6b8cfaa commit 9d3e5f0

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.2.2 (2023-09-15)
2+
3+
- da22d3e fix: relative path calc on Windows [#13](https://github.com/vite-plugin/vite-plugin-native/issues/13)
4+
15
## 2.2.1 (2023-06-29)
26

37
- 548fedb fix: avoid Vite built-in alias

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vite-plugin-native",
3-
"version": "2.2.1",
3+
"version": "2.2.2",
44
"description": "Supports Node/Electron C/C++ native addons",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",

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)