From fda36f8cf2330f40ff57f5cd87395cb901ceab22 Mon Sep 17 00:00:00 2001 From: Eric Taylor Date: Tue, 12 Mar 2024 10:42:34 -0600 Subject: [PATCH 1/2] chore: build cjs files for resolution --- package.json | 5 +++-- rollup.config.mjs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c5fc9ff19..0c6df7113 100644 --- a/package.json +++ b/package.json @@ -2,13 +2,14 @@ "name": "@avalabs/avalanchejs", "version": "4.0.4", "description": "Avalanche Platform JS Library", - "main": "dist/es/index.js", + "main": "dist/es/index.cjs", "types": "dist/index.d.ts", "typings": "dist/index.d.ts", "type": "module", "exports": { "import": "./dist/es/index.js", - "require": "./dist/index.js" + "require": "./dist/index.cjs", + "default": "./dist/es/index.js" }, "files": [ "dist", diff --git a/rollup.config.mjs b/rollup.config.mjs index ebe67c25d..2c3d5ad23 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -13,7 +13,7 @@ export default { ], // we don't want these dependencies bundled in the dist folder output: [ { - file: 'dist/index.js', + file: 'dist/index.cjs', format: 'cjs', plugins: [terser()], sourcemap: process.env.BUILD === 'production' ? false : true, From e67c0bb29a0bf872560414c8bcfcd4fadfdd25f5 Mon Sep 17 00:00:00 2001 From: Eric Taylor Date: Tue, 12 Mar 2024 12:57:39 -0600 Subject: [PATCH 2/2] chore: fix main path --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0c6df7113..96ca2f950 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@avalabs/avalanchejs", "version": "4.0.4", "description": "Avalanche Platform JS Library", - "main": "dist/es/index.cjs", + "main": "dist/index.cjs", "types": "dist/index.d.ts", "typings": "dist/index.d.ts", "type": "module",