Skip to content

Commit

Permalink
feat: add ESM-compatibility (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcosta7 authored Mar 23, 2023
1 parent c89e86d commit 3ecd963
Show file tree
Hide file tree
Showing 3 changed files with 495 additions and 7 deletions.
11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,21 @@
"version": "1.3.0",
"description": "Type-safe implementation of invariant with positionals.",
"main": "lib/index.js",
"module": "lib/index.mjs",
"typings": "lib/index.d.ts",
"exports": {
".": {
"types": "./lib/index.d.ts",
"require": "./lib/index.js",
"default": "./lib/index.mjs"
}
},
"author": "Artem Zakharchenko",
"license": "MIT",
"scripts": {
"test": "jest",
"clean": "rimraf ./lib",
"build": "yarn clean && tsc",
"build": "yarn clean && tsup",
"prepublishOnly": "yarn test && yarn build",
"release": "release publish"
},
Expand All @@ -29,6 +37,7 @@
"rimraf": "^3.0.2",
"ts-jest": "^27.0.3",
"ts-node": "^10.0.0",
"tsup": "^6.2.3",
"typescript": "^4.3.4"
},
"repository": {
Expand Down
14 changes: 14 additions & 0 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { defineConfig } from 'tsup'

export default defineConfig([
{
name: 'main',
entry: ['./src/index.ts'],
outDir: './lib',
format: ['esm', 'cjs'],
sourcemap: true,
clean: true,
bundle: true,
dts: true,
},
])
Loading

0 comments on commit 3ecd963

Please sign in to comment.