From bf5862ed4f738a6f6a80c86d54ecad0267b70695 Mon Sep 17 00:00:00 2001 From: RnkSngh Date: Wed, 30 Oct 2024 00:15:14 -0400 Subject: [PATCH] fix bundler to be compatible with commonJS for safe-sdk --- package.json | 5 ++--- src/scripts/update-contracts-script.ts | 2 +- tsup.config.ts | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 14ed78c5..fd2d571b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@open-ibc/vibc-core-smart-contracts", - "version": "4.0.7", + "version": "4.0.8", "main": "dist/index.js", "bin": { "verify-vibc-core-smart-contracts": "./dist/scripts/verify-contract-script.js", @@ -103,6 +103,5 @@ "import": "./dist/utils/constants.js", "types": "./dist/utils/constants.d.ts" } - }, - "type": "module" + } } diff --git a/src/scripts/update-contracts-script.ts b/src/scripts/update-contracts-script.ts index 1039b059..71a76414 100644 --- a/src/scripts/update-contracts-script.ts +++ b/src/scripts/update-contracts-script.ts @@ -19,7 +19,7 @@ async function main() { let extraContractFactories: Record | null = null; if (extraBindingsPath) { try { - extraContractFactories = await import(extraBindingsPath); + extraContractFactories = await require(extraBindingsPath); } catch (e) { throw new Error( `Failed to import extra contract factories from ${extraBindingsPath}: ${e}` diff --git a/tsup.config.ts b/tsup.config.ts index 94c188fe..494655d9 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -24,4 +24,5 @@ export default defineConfig({ sourcemap: true, clean: true, outDir: "./dist", + target: "node18", });