Skip to content

Commit e934528

Browse files
committed
Build both esm and cjs
1 parent a34dcef commit e934528

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
],
2222
"scripts": {
2323
"prebuild": "npm run clean && npm run lint && mkdir dist",
24-
"build": "tsc",
24+
"build": "npm run build:esm && npm run build:cjs",
25+
"build:esm": "tsc",
26+
"build:cjs": "tsc --module commonjs --outDir dist/cjs",
2527
"clean": "rm -rf dist",
2628
"lint": "eslint --report-unused-disable-directives . --color --ext .js,.ts,.tsx && tsc --noEmit",
2729
"prepublishOnly": "npm run build",

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"moduleResolution": "node",
1212
"declaration": true,
1313
"declarationMap": true,
14-
"outDir": "dist",
14+
"outDir": "dist/esm",
1515
"experimentalDecorators": true
1616
},
1717
"exclude": ["test", "dist"]

0 commit comments

Comments
 (0)