Skip to content

Commit 91a60fe

Browse files
chore: replace esbuild with tsc
1 parent 5f4da38 commit 91a60fe

File tree

4 files changed

+39
-8
lines changed

4 files changed

+39
-8
lines changed

package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"version": "2.0.4",
44
"description": "Thread-safe Helmet for React 16+ and friends",
55
"sideEffects": false,
6-
"main": "./lib/index.js",
7-
"module": "./lib/index.esm.js",
8-
"typings": "./lib/index.d.ts",
6+
"main": "./lib/cjs/index.js",
7+
"module": "./lib/esm/index.js",
8+
"typings": "./lib/esm/index.d.ts",
99
"repository": "http://github.com/staylor/react-helmet-async",
1010
"author": "Scott Taylor <[email protected]>",
1111
"license": "Apache-2.0",
@@ -29,7 +29,6 @@
2929
"@types/react": "18.2.39",
3030
"@types/shallowequal": "1.1.5",
3131
"@vitejs/plugin-react": "4.2.0",
32-
"esbuild": "0.19.8",
3332
"eslint": "8.54.0",
3433
"eslint-config-prettier": "9.0.0",
3534
"eslint-plugin-prettier": "5.0.1",
@@ -40,7 +39,6 @@
4039
"react": "18.2.0",
4140
"react-dom": "18.2.0",
4241
"rimraf": "5.0.5",
43-
"tsx": "4.6.1",
4442
"typescript": "5.2.2",
4543
"vite": "4.5.0",
4644
"vitest": "0.34.6"
@@ -55,8 +53,9 @@
5553
"test": "vitest run",
5654
"test-watch": "yarn test --watch",
5755
"test-update": "yarn test -u",
58-
"compile": "yarn run clean && NODE_ENV=production tsx build.ts && yarn types",
59-
"prepare": "yarn compile && husky install",
60-
"types": "tsc src/index.tsx --jsx react --declaration --esModuleInterop --allowJs --emitDeclarationOnly --outDir lib"
56+
"compile": "yarn run clean && yarn run compile:cjs && yarn run compile:esm",
57+
"compile:cjs": "tsc -p ./tsconfig.cjs.json",
58+
"compile:esm": "tsc -p ./tsconfig.esm.json",
59+
"prepare": "yarn compile && husky install"
6160
}
6261
}

tsconfig.build.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"exclude": [
4+
"__tests__",
5+
"lib",
6+
"node_modules"
7+
],
8+
"include": ["src"],
9+
"compilerOptions": {
10+
"declaration": true,
11+
"noEmit": false,
12+
"rootDir": "src"
13+
}
14+
}

tsconfig.cjs.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "./tsconfig.build.json",
3+
"compilerOptions": {
4+
"module": "CommonJS",
5+
"moduleResolution": "node",
6+
"target": "ESNext",
7+
"outDir": "lib/cjs"
8+
}
9+
}

tsconfig.esm.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "./tsconfig.build.json",
3+
"compilerOptions": {
4+
"module": "ES6",
5+
"moduleResolution": "node",
6+
"target": "ESNext",
7+
"outDir": "lib/esm"
8+
}
9+
}

0 commit comments

Comments
 (0)