Move buildnative to gyp
This commit is contained in:
parent
8c8c9cb12f
commit
16cea54a31
|
@ -8,6 +8,18 @@
|
|||
"include_dirs": [
|
||||
"native/target/release/",
|
||||
],
|
||||
"actions": [
|
||||
{
|
||||
"action_name": "build minify-html-ffi static library",
|
||||
"inputs": ["native/src/lib.rs"],
|
||||
"outputs": [
|
||||
"native/target/release/libminify_html_ffi.a",
|
||||
"native/target/release/minify_html_ffi.h",
|
||||
"native/target/release/minify_html_ffi.lib",
|
||||
],
|
||||
"action": ["node", "./buildnative.js"],
|
||||
}
|
||||
],
|
||||
"conditions": [
|
||||
["OS=='mac'", {
|
||||
"libraries": [
|
||||
|
|
|
@ -6,8 +6,7 @@ const common = {
|
|||
types: "index.d.ts",
|
||||
files: ["postinstall.js", "index.d.ts"],
|
||||
scripts: {
|
||||
build:
|
||||
"node buildnative.js && node-gyp build && shx mv build/Release/index.node index.node",
|
||||
build: "node-gyp build && shx mv build/Release/index.node index.node",
|
||||
clean:
|
||||
"cd native && cargo clean && cd .. && node-gyp clean && node-gyp configure && shx rm -f index.node",
|
||||
postinstall: "node postinstall.js",
|
||||
|
|
|
@ -36,9 +36,9 @@ const downloadNativeBinary = async () => {
|
|||
let binary;
|
||||
try {
|
||||
binary = await fetch(
|
||||
`https://wilsonl.in/minify-html/bin/nodejs/${
|
||||
pkg.version
|
||||
}/${pkg.name.split("/")[1]}/${binaryName}.node.gz`
|
||||
`https://wilsonl.in/minify-html/bin/nodejs/${pkg.version}/${
|
||||
pkg.name.split("/")[1]
|
||||
}/${binaryName}.node.gz`
|
||||
);
|
||||
} catch (e) {
|
||||
if (e instanceof StatusError && attempt < MAX_DOWNLOAD_ATTEMPTS) {
|
||||
|
|
Loading…
Reference in New Issue