packaging

This commit is contained in:
cupcakearmy 2022-10-18 15:35:49 +02:00
parent 07751ac477
commit dffb5a7b13
No known key found for this signature in database
GPG Key ID: 3235314B4D31232F
2 changed files with 7 additions and 1 deletions

View File

@ -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:*",

5
rename.sh Executable file
View File

@ -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