diff --git a/package.json b/package.json index 346f313..b612d25 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ ".": { "types": "./dist/esm/index.d.ts", "import": "./dist/esm/index.js", - "require": "./dist/cjs/index.js" + "require": "./dist/cjs/index.cjs" } }, "files": [ @@ -39,6 +39,7 @@ "test": "run-s build test:*", "build:esm": "tsc -p tsconfig.esm.json", "build:cjs": "tsc -p tsconfig.cjs.json && rename -S .js .cjs dist/cjs/**/*", + "build:rename": "./rename.sh", "build": "run-s clean build:*", "clean": "rm -rf ./dist", "dev": "run-p -ln dev:*", diff --git a/rename.sh b/rename.sh new file mode 100755 index 0000000..9a7b5c2 --- /dev/null +++ b/rename.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +# Rename .js files to .cjs +rename -S .js .cjs dist/cjs/** +sed -i '' 's/\.js"/\.cjs"/g' dist/cjs/index.cjs