Skip to content

Commit dbb3afc

Browse files
authored
Merge pull request #23 from fubhy/patch-1
Use "module" instead of "main" when exposing ESM.
2 parents f0287d9 + 3ed1a26 commit dbb3afc

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,4 @@ typings/
8282

8383
# End of https://www.gitignore.io/api/node
8484

85-
esm/
85+
dist/

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22
"name": "rxjs-hooks",
33
"version": "0.3.2",
44
"description": "React hooks for RxJS",
5-
"main": "esm/index.js",
5+
"module": "dist/esm/index.js",
6+
"main": "dist/cjs/index.js",
67
"author": "LongYinan <lynweklm@gmail.com>",
78
"license": "MIT",
8-
"typings": "esm/index.d.ts",
9+
"typings": "dist/cjs/index.d.ts",
910
"sideEffects": false,
1011
"scripts": {
11-
"build": "rm -rf esm && tsc -p src/tsconfig.json --outDir esm",
12+
"build": "yarn build:esm && yarn build:cjs",
13+
"build:esm": "rm -rf dist/esm && tsc -p src/tsconfig.json --module es2015 --target es5 --outDir dist/esm",
14+
"build:cjs": "rm -rf dist/cjs && tsc -p src/tsconfig.json --module commonjs --target es5 --outDir dist/cjs",
1215
"lint": "tslint -c tslint.json -p src/tsconfig.json",
1316
"start": "webpack-dev-server --config ./tools/webpack.config.js --progress --color",
1417
"test": "NODE_ENV=test jest --no-cache --ci"

0 commit comments

Comments
 (0)