Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: distribute the package as ESM #6

Merged
merged 7 commits into from
Mar 8, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.CI_GITHUB_TOKEN }}
Expand Down
11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
"version": "0.4.6",
"description": "Type-safe implementation of EventEmitter for browser and Node.js",
"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"
}
},
"repository": "[email protected]:open-draft/strict-event-emitter.git",
"author": "Artem Zakharchenko <[email protected]>",
"license": "MIT",
Expand All @@ -12,7 +20,7 @@
"test": "jest",
"test:ts": "tsc -p test/typings.tsconfig.json",
"clean": "rimraf ./lib",
"build": "pnpm clean && tsc",
"build": "yarn clean && tsup",
"release": "release publish"
},
"files": [
Expand All @@ -27,6 +35,7 @@
"rimraf": "^3.0.2",
"ts-jest": "^29.0.3",
"ts-node": "^9.1.1",
"tsup": "^6.2.3",
"typescript": "4.8"
}
}
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