diff --git a/.gitignore b/.gitignore index 0264808aec..95c09a18a6 100644 --- a/.gitignore +++ b/.gitignore @@ -66,6 +66,7 @@ typings/ # build output lib/ +esm .DS_Store diff --git a/package.json b/package.json index 596db2d5c6..c628524255 100644 --- a/package.json +++ b/package.json @@ -3,16 +3,20 @@ "version": "6.1.0", "description": "Collection of React Hooks", "main": "lib/index.js", + "module": "lib/es/index.js", "files": [ - "lib/" + "lib/", + "esm/" ], "types": "lib/index.d.ts", "typings": "lib/index.d.ts", "scripts": { "start": "yarn storybook", "test": "echo hmm...", - "build": "tsc", - "clean": "rimraf lib storybook-static", + "build:cjs": "tsc", + "build:es": "tsc -m esNext --outDir esm", + "build": "yarn build:cjs && yarn build:es", + "clean": "rimraf lib storybook-static esm", "storybook": "start-storybook -p 6008", "storybook:build": "build-storybook", "storybook:upload": "gh-pages -d storybook-static",