diff --git a/index.js b/index.js index 019a2a4..7269193 100644 --- a/index.js +++ b/index.js @@ -1,10 +1,11 @@ +const path = require('path') const { loadBinding } = require('@node-rs/helper') try { // __dirname means load native addon from current dir // 'index' means native addon name is `index` // the value of this two arguments was decided by `build` script in `package.json` - module.exports = loadBinding(__dirname, 'index') + module.exports = loadBinding(path.join(__dirname, '..', `rs-diff-${process.platform}`), 'index') } catch (e) { try { module.exports = require(`@swc-node/core-${platform()}`) diff --git a/npm/darwin/package.json b/npm/darwin/package.json index 0a4be1f..f149c72 100644 --- a/npm/darwin/package.json +++ b/npm/darwin/package.json @@ -1,6 +1,6 @@ { "name": "rs-diff-darwin", - "version": "0.0.1", + "version": "0.0.2", "description": "Template project for writing node package with napi-rs", "repository": "https://git.trj.tw/nodejs/rs-diff.git", "license": "MIT", diff --git a/npm/linux/package.json b/npm/linux/package.json index 30e688d..1a7266f 100644 --- a/npm/linux/package.json +++ b/npm/linux/package.json @@ -1,6 +1,6 @@ { "name": "rs-diff-linux", - "version": "0.0.1", + "version": "0.0.2", "description": "Template project for writing node package with napi-rs", "repository": "https://git.trj.tw/nodejs/rs-diff.git", "license": "MIT", diff --git a/package.json b/package.json index 2c53bb6..85ea57d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rs-diff", - "version": "0.0.1", + "version": "0.0.2", "description": "Template project for writing node package with napi-rs", "author": "Jay ", "main": "index.js", @@ -58,7 +58,7 @@ } }, "optionalDependencies": { - "rs-diff-darwin": "^0.0.1", - "rs-diff-linux": "^0.0.1" + "rs-diff-darwin": "^0.0.2", + "rs-diff-linux": "^0.0.2" } }