Skip to content

Commit 6581679

Browse files
committed
feat: migrate from webpack to tsup. dual-export esm and cjs
1 parent ed29204 commit 6581679

File tree

5 files changed

+648
-753
lines changed

5 files changed

+648
-753
lines changed

package.json

+14-10
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
"name": "better-sse",
33
"description": "Dead simple, dependency-less, spec-compliant server-sent events implementation for Node, written in TypeScript.",
44
"version": "0.13.0",
5-
"main": "./build/index.js",
6-
"types": "./build/index.d.ts",
75
"license": "MIT",
86
"author": "Matthew W. <[email protected]>",
97
"repository": "github:MatthewWid/better-sse",
@@ -18,12 +16,21 @@
1816
"events"
1917
],
2018
"scripts": {
21-
"build": "webpack --env production",
19+
"build": "tsup",
2220
"test": "vitest",
23-
"clean": "rimraf ./build",
2421
"format": "prettier --write ./src/**/*.ts",
2522
"lint": "eslint \"./src/**/*.ts\"",
26-
"prepublishOnly": "npm-run-all clean format test build"
23+
"prepublishOnly": "npm-run-all format test build"
24+
},
25+
"main": "./build/index.js",
26+
"module": "./build/index.mjs",
27+
"types": "./build/index.d.ts",
28+
"exports": {
29+
".": {
30+
"types": "./build/index.d.ts",
31+
"require": "./build/index.js",
32+
"import": "./build/index.mjs"
33+
}
2734
},
2835
"files": [
2936
"build",
@@ -45,13 +52,10 @@
4552
"eventsource": "^2.0.2",
4653
"npm-run-all": "^4.1.5",
4754
"prettier": "^3.3.3",
48-
"rimraf": "^6.0.1",
49-
"ts-loader": "^9.5.1",
5055
"ts-node": "^10.9.2",
56+
"tsup": "^8.3.0",
5157
"typescript": "^5.6.3",
52-
"vitest": "^2.1.3",
53-
"webpack": "^5.95.0",
54-
"webpack-cli": "^5.1.4"
58+
"vitest": "^2.1.3"
5559
},
5660
"packageManager": "[email protected]"
5761
}

0 commit comments

Comments
 (0)