Skip to content

Commit 8cc39df

Browse files
committed
Build for node and esm
1 parent 81a09ee commit 8cc39df

3 files changed

Lines changed: 22 additions & 5 deletions

File tree

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33
"version": "0.0.2",
44
"description": "Tools for React",
55
"main": "dist/",
6+
"module": "dist/esm",
7+
"sideEffects": false,
68
"scripts": {
7-
"build": "tsc",
9+
"build": "npm run build:node && npm run build:esm",
10+
"build:node": "tsc",
11+
"build:esm": "tsc --project tsconfig.esnext.json",
812
"lint": "eslint --ext js,ts,tsx src",
913
"lint:fix": "npm run lint -- --fix",
1014
"test": "jest --verbose --passWithNoTests",

tsconfig.esnext.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"compilerOptions": {
3+
"module": "esnext",
4+
"target": "es5",
5+
"jsx": "react",
6+
"moduleResolution": "Node",
7+
"allowSyntheticDefaultImports": true,
8+
"esModuleInterop": true,
9+
"outDir": "./dist/esm",
10+
"declaration": true,
11+
"strict": true,
12+
},
13+
"include": ["src"],
14+
"exclude": ["node_modules", "**/__test__/*", "**/__tests__/*"]
15+
}

tsconfig.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
{
22
"compilerOptions": {
3-
"module": "esnext",
4-
"target": "ES5",
3+
"target": "es5",
54
"jsx": "react",
6-
"moduleResolution": "Node",
75
"esModuleInterop": true,
86
"outDir": "./dist",
97
"declaration": true,
108
"strict": true,
11-
"sourceMap": false
9+
"sourceMap": true
1210
},
1311
"include": ["src"],
1412
"exclude": ["node_modules", "**/__test__/*", "**/__tests__/*"]

0 commit comments

Comments
 (0)