Re-introduce cjs build

This commit is contained in:
Franck Royer 2022-06-16 15:55:04 +10:00
parent 53a3f7fcbf
commit ebbb0a2713
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 4 additions and 1 deletions

View File

@ -6,7 +6,8 @@
"exports": { "exports": {
".": { ".": {
"types": "./dist/esm/index.d.ts", "types": "./dist/esm/index.d.ts",
"import": "./dist/esm/index.js" "import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
} }
}, },
"type": "module", "type": "module",
@ -23,6 +24,7 @@
"scripts": { "scripts": {
"prepare": "husky install", "prepare": "husky install",
"build": "rimraf ./dist; run-s build:**", "build": "rimraf ./dist; run-s build:**",
"build:cjs": "tsc --module commonjs --outDir dist/cjs",
"build:esm": "tsc && node build-scripts/fix-imports.js", "build:esm": "tsc && node build-scripts/fix-imports.js",
"build:umd": "rollup --config rollup.config.js -- dist/esm/index.js", "build:umd": "rollup --config rollup.config.js -- dist/esm/index.js",
"build:umd:min": "terser --ecma 6 --compress --mangle -o dist/umd/index.min.js -- dist/umd/index.js && gzip -9 -c dist/umd/index.min.js > dist/umd/index.min.js.gz", "build:umd:min": "terser --ecma 6 --compress --mangle -o dist/umd/index.min.js -- dist/umd/index.js && gzip -9 -c dist/umd/index.min.js > dist/umd/index.min.js.gz",
@ -148,6 +150,7 @@
}, },
"files": [ "files": [
"dist/esm", "dist/esm",
"dist/cjs",
"dist/umd", "dist/umd",
"src/*.ts", "src/*.ts",
"src/lib/**/*.ts", "src/lib/**/*.ts",