Skip to content

Commit 910c937

Browse files
committed
use tsup to build/watch the package
1 parent b0814f9 commit 910c937

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

package.json

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
"type": "git",
1717
"url": "http://github.com/graphql/dataloader.git"
1818
},
19-
"main": "index.js",
20-
"typings": "index.d.ts",
19+
"type": "module",
20+
"main": "dist/index.cjs",
21+
"module": "dist/index.js",
22+
"typings": "dist/index.d.ts",
2123
"scripts": {
2224
"test": "npm run lint && npm run check && npm run testonly",
2325
"test:ci": "npm run lint && npm run check && npm run testonly -- --coverage",
@@ -26,13 +28,14 @@
2628
"build": "babel src --ignore src/__tests__ --out-dir dist/ ; cp src/index.js dist/index.js.flow ; cp src/index.d.ts dist/",
2729
"watch": "babel resources/watch.js | node",
2830
"testonly": "jest src",
31+
"check": "tsc --noEmit --pretty",
32+
"build": "tsup",
33+
"watch": "tsup --watch",
2934
"prerelease": ". ./resources/prepublish.sh",
3035
"release": "changeset publish"
3136
},
3237
"files": [
33-
"index.js",
34-
"index.js.flow",
35-
"index.d.ts",
38+
"dist/*",
3639
"README.md",
3740
"LICENSE",
3841
"PATENTS"
@@ -71,5 +74,17 @@
7174
}
7275
}
7376
]
77+
},
78+
"tsup": {
79+
"entry": [
80+
"src/index.ts"
81+
],
82+
"format": [
83+
"cjs",
84+
"esm"
85+
],
86+
"dts": true,
87+
"sourcemap": true,
88+
"clean": true
7489
}
7590
}

0 commit comments

Comments
 (0)