Skip to content

Commit df1e08b

Browse files
committed
Publish as ESM-only
Require Node v20.19 (which enables require(esm) support by default). This new package is supposed to be compatible with Apollo Server 4 which does an elaborate dance to publish as both CJS and ESM, but we already decided it was OK for this package itself to require Node v20. Turns out CJS-only plays poorly with the AS4-style dual build: apollographql/apollo-server#8069 And we're likely to go ESM-only with AS5 because newer Node makes this easier. So let's do that here too.
1 parent bfa8775 commit df1e08b

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

.changeset/modern-kiwis-look.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@as-integrations/express5': major
3+
---
4+
5+
Publish as ESM-only, and require Node v20.19 (which enables require(esm) support by default).

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@
1212
"bugs": {
1313
"url": "https://github.com/apollo-server-integrations/apollo-server-integration-express5/issues"
1414
},
15-
"main": "dist/index.js",
16-
"types": "dist/index.d.ts",
15+
"type": "module",
16+
"exports": {
17+
".": "./dist/index.js"
18+
},
1719
"engines": {
18-
"node": ">=20"
20+
"node": ">=20.19"
1921
},
2022
"scripts": {
2123
"build": "tsc --build tsconfig.build.json",

tsconfig.base.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
"compilerOptions": {
33
"rootDir": "./src",
44
"outDir": "./dist",
5-
"target": "es2020",
6-
"module": "commonjs",
7-
"moduleResolution": "node",
5+
"target": "ESNext",
6+
"module": "NodeNext",
87
"esModuleInterop": true,
98
"sourceMap": true,
109
"declaration": true,

0 commit comments

Comments
 (0)