Skip to content

Commit

Permalink
feat: removed cjs support
Browse files Browse the repository at this point in the history
  • Loading branch information
Shahaed committed Oct 1, 2024
1 parent 33dac7c commit 8f51e11
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 31 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This is [http-status-codes](https://github.com/prettymuchbryce/http-status-codes

> Version 1.0.1 significantly reduces the size of the package. Good for browsers now.
> Version 1.0.2 supports both CommonJS and ES Modules but doubles the size of the package (since we're now publishing two files).
> Version 2.0.0 only supports ES Modules.
## Installation

Expand Down
22 changes: 6 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,18 @@
{
"name": "http-status-typed",
"version": "1.0.2",
"version": "2.0.0",
"description": "HTTP status codes, but in a typescript enum so you have a parent type",
"main": "dist/cjs/index.min.js",
"module": "dist/esm/index.min.js",
"types": "dist/esm/index.d.ts",
"main": "dist/index.min.js",
"types": "dist/index.d.ts",
"type": "module",
"files": [
"/dist/**/*.min.js",
"/dist/**/*.d.ts"
],
"exports": {
".": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
}
},
"scripts": {
"build": "npm run build:esm && npm run build:cjs",
"build:esm": "tsc -p tsconfig.esm.json",
"build:cjs": "tsc -p tsconfig.cjs.json",
"compress:cjs": "terser dist/cjs/index.js --compress --output dist/cjs/index.min.js",
"compress:esm": "terser dist/esm/index.js --compress --output dist/esm/index.min.js",
"publish": "npm run build && npm run compress:cjs && npm run compress:esm"
"build": "tsc -p tsconfig.json",
"compress": "terser dist/index.js --compress --output dist/index.min.js",
"publish": "npm run build && npm run compress"
},
"keywords": [
"node",
Expand Down
7 changes: 0 additions & 7 deletions tsconfig.cjs.json

This file was deleted.

7 changes: 0 additions & 7 deletions tsconfig.esm.json

This file was deleted.

3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"compilerOptions": {
// Generate d.ts files
"declaration": true,
"outDir": "dist"
"outDir": "dist",
"module": "ES6"
}
}

0 comments on commit 8f51e11

Please sign in to comment.