Skip to content

Commit d799f65

Browse files
authored
Merge pull request #4 from kapouer/esm
Export an actually working es6 module
2 parents 2a48ae4 + eb839b7 commit d799f65

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33
"version": "1.6.2",
44
"description": "Parse bytes to human readable sizes (4747) → ('4.75 KB') and vice versa.",
55
"main": "dist/index.js",
6+
"exports": {
7+
"require": "./dist/index.js",
8+
"import": "./dist/index.mjs"
9+
},
610
"types": "typings/index.d.ts",
711
"scripts": {
812
"test": "jest",
9-
"build": "babel lib -d dist",
13+
"build": "babel lib -d dist && (cat dist/index.js; printf '\nexport default xbytes;') > dist/index.mjs",
1014
"preversion": "npm run build",
1115
"version": "npm test",
1216
"postversion": "git push gitlab master && git push github master"

0 commit comments

Comments
 (0)