Skip to content

Commit 65d9e14

Browse files
authored
Add package.json exports property
This allows modern build systems (vite) to properly use the correct module type (ESM). See sveltejs/kit#928 for more details.
1 parent d317d06 commit 65d9e14

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

package.json

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
"main": "dist/index.cjs.js",
1919
"module": "dist/index.esm.js",
2020
"typings": "dist/index.d.ts",
21+
"type": "module",
22+
"exports": {
23+
"import": "./dist/index.esm.js",
24+
"require": "./dist/index.cjs.js"
25+
},
2126
"scripts": {
2227
"test": "ts-node node_modules/tape/bin/tape test/**/*.ts",
2328
"prepublishOnly": "npm test && npm run lint && npm run build",

0 commit comments

Comments
 (0)