Skip to content

Commit 85205c1

Browse files
authored
Merge pull request #178 from liuyuchenzh/master
feat: emit code in ES Module format
2 parents 27cadf9 + fc1ba07 commit 85205c1

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ typings/
6666

6767
# build output
6868
lib/
69+
esm
6970

7071
.DS_Store
7172

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,20 @@
33
"version": "6.1.0",
44
"description": "Collection of React Hooks",
55
"main": "lib/index.js",
6+
"module": "lib/es/index.js",
67
"files": [
7-
"lib/"
8+
"lib/",
9+
"esm/"
810
],
911
"types": "lib/index.d.ts",
1012
"typings": "lib/index.d.ts",
1113
"scripts": {
1214
"start": "yarn storybook",
1315
"test": "echo hmm...",
14-
"build": "tsc",
15-
"clean": "rimraf lib storybook-static",
16+
"build:cjs": "tsc",
17+
"build:es": "tsc -m esNext --outDir esm",
18+
"build": "yarn build:cjs && yarn build:es",
19+
"clean": "rimraf lib storybook-static esm",
1620
"storybook": "start-storybook -p 6008",
1721
"storybook:build": "build-storybook",
1822
"storybook:upload": "gh-pages -d storybook-static",

0 commit comments

Comments
 (0)