Skip to content

Commit 12cc7cb

Browse files
committed
minor fixes, added README
1 parent c2fa5c3 commit 12cc7cb

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

examples/with-esm/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## Envelop with ESM
2+
3+
If you are using ESM in your project, you can consume Envelop's core and plugins using ESM.
4+
5+
All bundles produced from this repo has `mjs` in addition to CommonJS.
6+
7+
### Running this example
8+
9+
To run this example:
10+
11+
1. Make sure to install deps on the root of the repo.
12+
2. Run `yarn build`.
13+
3. Run `yarn dev` in this directory.
14+

examples/with-esm/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
"version": "0.0.1",
44
"scripts": {
55
"dev": "tsup-node src/index.ts --format esm --watch src --onSuccess \"node dist/index.mjs\"",
6-
"dev:cjs": "tsup-node src/index.ts --format cjs --watch src --onSuccess \"node dist/index.js\"",
7-
"start": "tsup-node src/index.ts --format esm --onSuccess \"node dist/index.mjs\"",
8-
"start:cjs": "tsup-node src/index.ts --format cjs --onSuccess \"node dist/index.js\""
6+
"start": "tsup-node src/index.ts --format esm --onSuccess \"node dist/index.mjs\""
97
},
108
"dependencies": {
119
"@envelop/core": "*",

examples/with-esm/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ app.route({
2626
method: ['GET', 'POST'],
2727
url: '/graphql',
2828
async handler(req, res) {
29-
const { parse, validate, contextFactory, execute, schema } = getEnveloped();
29+
const { parse, validate, contextFactory, execute, schema } = getEnveloped({ req });
3030
const request = {
3131
body: req.body,
3232
headers: req.headers,

0 commit comments

Comments
 (0)