Skip to content

Commit

Permalink
Merge pull request #4 from jotaijs/fix-esm-builds
Browse files Browse the repository at this point in the history
fix: esm builds
  • Loading branch information
dmaskasky authored Jan 30, 2025
2 parents 015bb9f + f5ab1ff commit 4ab5bd4
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 4 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"packageManager": "[email protected]",
"scripts": {
"compile": "rm -rf dist && pnpm run '/^compile:.*/'",
"compile:esm": "tsc -p tsconfig.esm.json",
"compile:esm": "tsc -p tsconfig.esm.json && tsc-alias -p tsconfig.esm.json",
"compile:cjs": "tsc -p tsconfig.cjs.json && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
"fix": "pnpm run '/^fix:.*/'",
"fix:format": "prettier --write .",
Expand Down Expand Up @@ -88,6 +88,7 @@
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-error-boundary": "^4.0.11",
"tsc-alias": "^1.8.10",
"typescript": "^5.7.2",
"typescript-eslint": "^8.21.0",
"vite": "^6.0.11",
Expand Down
118 changes: 118 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions tsconfig.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"module": "esnext",
"moduleResolution": "node",
"declaration": true,
"declarationMap": true,
"sourceMap": true
},
"include": ["src"],
"exclude": ["**/tests/*", "**/*.test.*"]
"exclude": ["**/tests/*", "**/*.test.*"],
"tsc-alias": {
"forceReplace": true,
"replaceExtensions": {
".ts": ".js",
".tsx": ".js"
},
"resolveFullPaths": true
}
}

0 comments on commit 4ab5bd4

Please sign in to comment.