Skip to content

Commit

Permalink
refactor!: improve ESM/CJS compatibility, require node 14 or higher
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Mar 23, 2023
1 parent b8d3825 commit 26d630e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 17 deletions.
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ jobs:
- 18
- 16
- 14
- 12
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
Expand Down
3 changes: 0 additions & 3 deletions package.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@ import {name, version} from './package.json'
export default defineConfig({
extract: {
rules: {
'ae-missing-release-tag': 'off',
'tsdoc-undefined-tag': 'off',
},
},

legacyExports: true,

rollup: {
plugins: [
visualizer({
Expand Down
21 changes: 9 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,27 @@
"version": "0.1.0",
"description": "Streaming, source-agnostic EventSource/Server-Sent Events parser",
"sideEffects": false,
"types": "./dist/index.d.ts",
"source": "./src/index.ts",
"module": "./dist/index.esm.js",
"main": "./dist/index.js",
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"source": "./src/index.ts",
"require": "./dist/index.js",
"node": {
"import": "./dist/index.cjs.mjs",
"require": "./dist/index.js"
},
"import": "./dist/index.esm.js",
"default": "./dist/index.esm.js"
"require": "./dist/index.cjs",
"import": "./dist/index.js",
"default": "./dist/index.js"
},
"./package.json": "./package.json"
},
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"source": "./src/index.ts",
"types": "./dist/index.d.ts",
"scripts": {
"clean": "rimraf dist coverage",
"build": "pkg-utils build && pkg-utils --strict",
"prebuild": "npm run clean",
"lint": "eslint . && tsc --noEmit",
"test": "vitest",
"test": "vitest --reporter=verbose",
"posttest": "npm run lint",
"prepublishOnly": "npm run build"
},
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "ES2020",
"target": "ES2015",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
Expand Down

0 comments on commit 26d630e

Please sign in to comment.