From 3c151dae5fc9d574c248f6c4af5f323858cfafd3 Mon Sep 17 00:00:00 2001 From: Ivaylo Nikolov Date: Thu, 20 Feb 2025 15:47:00 +0200 Subject: [PATCH] chore: update cryptography to use rollup Signed-off-by: Ivaylo Nikolov --- packages/cryptography/Taskfile.yml | 1 + packages/cryptography/package.json | 3 ++- packages/cryptography/rollup.config.js | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 packages/cryptography/rollup.config.js diff --git a/packages/cryptography/Taskfile.yml b/packages/cryptography/Taskfile.yml index 9cc175960..596c0277f 100644 --- a/packages/cryptography/Taskfile.yml +++ b/packages/cryptography/Taskfile.yml @@ -28,6 +28,7 @@ tasks: - task: format - task: lint - npx babel src -d lib --out-file-extension .cjs > /dev/null + - npx rollup -c > /dev/null - npx yalc publish > /dev/null clean: diff --git a/packages/cryptography/package.json b/packages/cryptography/package.json index c17efeb0f..531a08e3b 100644 --- a/packages/cryptography/package.json +++ b/packages/cryptography/package.json @@ -32,7 +32,7 @@ "exports": { "./package.json": "./package.json", ".": { - "import": "./src/index.js", + "import": "./lib/index.js", "require": "./lib/index.cjs" } }, @@ -41,6 +41,7 @@ "repository": "https://github.com/hashgraph/hedera-sdk-js", "bugs": "https://github.com/hashgraph/hedera-sdk-js/issues", "type": "module", + "sideEffects": false, "keywords": [ "hedera", "hashgraph", diff --git a/packages/cryptography/rollup.config.js b/packages/cryptography/rollup.config.js new file mode 100644 index 000000000..a2f6686e1 --- /dev/null +++ b/packages/cryptography/rollup.config.js @@ -0,0 +1,14 @@ +import terser from "@rollup/plugin-terser"; + +export default [ + { + input: "src/index.js", + output: { + dir: "lib/", + format: "esm", + sourcemap: true, + preserveModules: true, + plugins: [terser()], + }, + }, +];