diff --git a/package.json b/package.json index c5fc9ff19..96ca2f950 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/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,