Skip to content

Commit

Permalink
Merge pull request #15 from vite-plugin/v2.2.2
Browse files Browse the repository at this point in the history
V2.2.2
  • Loading branch information
caoxiemeihao authored Sep 15, 2024
2 parents 22b9ed0 + 6b8cfaa commit 9d3e5f0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.2.2 (2023-09-15)

- da22d3e fix: relative path calc on Windows [#13](https://github.com/vite-plugin/vite-plugin-native/issues/13)

## 2.2.1 (2023-06-29)

- 548fedb fix: avoid Vite built-in alias
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vite-plugin-native",
"version": "2.2.1",
"version": "2.2.2",
"description": "Supports Node/Electron C/C++ native addons",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ export default function native(options: NativeOptions): Plugin {
return
}

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

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

if (!exists) {
const nativeDest = path.join(nativeNodeModules, nativeName)
const nativeDest = path.posix.join(nativeNodeModules, nativeName)
copy(nativeRoot, nativeDest)

const dependencies = await flatDependencies(nativeRoot)
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export async function getDependenciesNatives(root = process.cwd()): Promise<Map<
for (const dep of deps) {
if (natives.has(dep)) continue

const depPath = path.join(node_modules_path, dep)
const depPath = path.posix.join(node_modules_path, dep)
const nativeFiles = await globNativeFiles(depPath)

if (nativeFiles.length) {
Expand Down

0 comments on commit 9d3e5f0

Please # to comment.