Have gyp copy the .node file

This commit is contained in:
dancoffman 2022-11-03 23:14:11 -07:00
parent 3f66b35664
commit 92242c725b
No known key found for this signature in database
GPG Key ID: 47B1F53E36A9B3CC
3 changed files with 17 additions and 3 deletions

View File

@ -6,11 +6,9 @@ clean:
rm -f *.a
rm -f *.o
build: kzg.cxx kzg.ts package.json Makefile
build: kzg.cxx kzg.ts package.json binding.gyp Makefile
cd ../../src; make lib
yarn node-gyp rebuild
cp build/Release/kzg.node .
cp build/Release/kzg.node ./dist
test: build
yarn jest

View File

@ -22,6 +22,21 @@
],
"dependencies": ["<!(node -p \"require('node-addon-api').gyp\")"],
"defines": ["NAPI_DISABLE_CPP_EXCEPTIONS"]
},
{
"target_name": "action_after_build",
"type": "none",
"dependencies": ["kzg"],
"copies": [
{
"files": ["./build/Release/kzg.node"],
"destination": "."
},
{
"files": ["./build/Release/kzg.node"],
"destination": "./dist"
}
]
}
]
}

View File

@ -5,6 +5,7 @@
"author": "Dan Coffman",
"license": "MIT",
"main": "dist/kzg.js",
"types": "dist/dts/kzg.d.ts",
"devDependencies": {
"@babel/preset-typescript": "^7.18.6",
"@rollup/plugin-typescript": "^9.0.2",