From 3b848513ce5d94262612c8a3c0901c26107a0518 Mon Sep 17 00:00:00 2001 From: HL <36248745+honestbonsai@users.noreply.github.com> Date: Thu, 18 Feb 2021 19:46:24 +0000 Subject: [PATCH] Make external ganache core work in cli --- .../filecoin/webpack/webpack.node.config.ts | 16 +++++++++++++++- src/packages/ganache/package.json | 1 + src/packages/ganache/tsconfig.json | 12 +++++++++--- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/chains/filecoin/filecoin/webpack/webpack.node.config.ts b/src/chains/filecoin/filecoin/webpack/webpack.node.config.ts index 39ea6cdc13..8ae8c6a978 100644 --- a/src/chains/filecoin/filecoin/webpack/webpack.node.config.ts +++ b/src/chains/filecoin/filecoin/webpack/webpack.node.config.ts @@ -13,8 +13,22 @@ const config: webpack.Configuration = merge({}, base, { "ipfs-http-client", "ipfs-http-server", "ipld-dag-cbor", + "bigint-buffer", "leveldown", - "secp256k1" + "secp256k1", + "keccak", + { + "@ganache/core": path.resolve( + __dirname, + "../", + "dist", + "node", + "ganache.min.js" + ) + } + ], + plugins: [ + new webpack.BannerPlugin({ banner: "#!/usr/bin/env node", raw: true }) ], module: { rules: [ diff --git a/src/packages/ganache/package.json b/src/packages/ganache/package.json index bd20933dfe..d63e20d6bb 100644 --- a/src/packages/ganache/package.json +++ b/src/packages/ganache/package.json @@ -50,6 +50,7 @@ "truffle" ], "devDependencies": { + "@ganache/core": "^0.1.0", "@ganache/cli": "^0.1.0", "@ganache/core": "^0.1.0", "@ganache/flavors": "^0.1.0", diff --git a/src/packages/ganache/tsconfig.json b/src/packages/ganache/tsconfig.json index d911a51de9..74b8cf442e 100644 --- a/src/packages/ganache/tsconfig.json +++ b/src/packages/ganache/tsconfig.json @@ -3,9 +3,15 @@ "compilerOptions": { "outDir": "lib" }, - "include": ["index.ts", "src/**/*", "src/cli.ts"], + "include": [ + "index.ts", + "src/**/*", + "src/cli.ts" + ], "paths": { - "@ganache/cli/src/cli": ["../cli/src/cli"] + "@ganache/cli/src/cli": [ + "../cli/src/cli" + ] }, "references": [ { @@ -25,4 +31,4 @@ "path": "../../chains/filecoin/filecoin" } ] -} +} \ No newline at end of file