diff --git a/build.js b/build.js index eefb2d3..e576c5a 100644 --- a/build.js +++ b/build.js @@ -32,7 +32,7 @@ async function bundleSafeChain() { platform: "node", target: "node24", outfile: "./build/bin/safe-chain.cjs", - external: ["certifi", "node-forge"], + external: ["certifi"], }); } @@ -52,14 +52,10 @@ async function copyShellScripts() { } async function copyCertifi() { - await mkdir("./build/node_modules/certifi", { recursive: true }); await mkdir("./build/node_modules/certifi", { recursive: true }); await cp("./node_modules/certifi/", "./build/node_modules/certifi", { recursive: true, }); - await cp("./node_modules/node-forge/", "./build/node_modules/node-forge", { - recursive: true, - }); } async function copyAndModifyPackageJson() { const packageJsonContent = await readFile( @@ -82,7 +78,6 @@ async function copyAndModifyPackageJson() { outputPath: "dist", assets: [ "node_modules/certifi/**/*", - "node_modules/node-forge/**/*", "bin/startup-scripts/**/*", "bin/path-wrappers/**/*", ], diff --git a/packages/safe-chain/src/registryProxy/certUtils.js b/packages/safe-chain/src/registryProxy/certUtils.js index 6b326c8..178f764 100644 --- a/packages/safe-chain/src/registryProxy/certUtils.js +++ b/packages/safe-chain/src/registryProxy/certUtils.js @@ -3,6 +3,9 @@ import path from "path"; import fs from "fs"; import os from "os"; +// @ts-ignore +forge.options.usePureJavaScript = true; + const certFolder = path.join(os.homedir(), ".safe-chain", "certs"); const ca = loadCa();