From dffb5a7b13b5f0595514db03e7f39dffb8dfa1c8 Mon Sep 17 00:00:00 2001 From: cupcakearmy Date: Tue, 18 Oct 2022 15:35:49 +0200 Subject: [PATCH] packaging --- package.json | 3 ++- rename.sh | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100755 rename.sh 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