Skip to content

Commit f5ab1ff

Browse files
committed
fix: esm builds
1 parent 015bb9f commit f5ab1ff

File tree

3 files changed

+129
-4
lines changed

3 files changed

+129
-4
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"packageManager": "[email protected]",
4343
"scripts": {
4444
"compile": "rm -rf dist && pnpm run '/^compile:.*/'",
45-
"compile:esm": "tsc -p tsconfig.esm.json",
45+
"compile:esm": "tsc -p tsconfig.esm.json && tsc-alias -p tsconfig.esm.json",
4646
"compile:cjs": "tsc -p tsconfig.cjs.json && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
4747
"fix": "pnpm run '/^fix:.*/'",
4848
"fix:format": "prettier --write .",
@@ -88,6 +88,7 @@
8888
"react": "^19.0.0",
8989
"react-dom": "^19.0.0",
9090
"react-error-boundary": "^4.0.11",
91+
"tsc-alias": "^1.8.10",
9192
"typescript": "^5.7.2",
9293
"typescript-eslint": "^8.21.0",
9394
"vite": "^6.0.11",

pnpm-lock.yaml

+118
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tsconfig.esm.json

+9-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"outDir": "./dist",
5-
"module": "esnext",
6-
"moduleResolution": "node",
75
"declaration": true,
86
"declarationMap": true,
97
"sourceMap": true
108
},
119
"include": ["src"],
12-
"exclude": ["**/tests/*", "**/*.test.*"]
10+
"exclude": ["**/tests/*", "**/*.test.*"],
11+
"tsc-alias": {
12+
"forceReplace": true,
13+
"replaceExtensions": {
14+
".ts": ".js",
15+
".tsx": ".js"
16+
},
17+
"resolveFullPaths": true
18+
}
1319
}

0 commit comments

Comments
 (0)