Skip to content

Commit 067d32e

Browse files
committed
build: Add build for native ES modules
1 parent c9f97ed commit 067d32e

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
"description": "",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
7+
"module": "dist/esm/index.js",
78
"scripts": {
89
"add-contributor": "kcd-scripts contributors add",
9-
"build": "tsc -p tsconfig.build.json",
10+
"build": "npm-run-all build:cjs build:esm",
11+
"build:cjs": "tsc -p tsconfig.build.json",
12+
"build:esm": "tsc -p tsconfig.esm.json",
1013
"lint": "kcd-scripts lint",
1114
"test:unit": "kcd-scripts test --no-watch --config=jest.config.js",
1215
"validate": "kcd-scripts validate build,lint,test,typecheck",

tsconfig.esm.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"module": "esnext",
5+
"outDir": "./dist/esm",
6+
"moduleResolution": "node",
7+
"declaration": true,
8+
"noEmit": false
9+
},
10+
"exclude": ["test", "dist"]
11+
}

0 commit comments

Comments
 (0)