pkgroll -p tsconfig.src.json
# got an error
src/index.ts(2,15): error TS6142: Module './components/stats' was resolved to
'/xxx/src/components/stats/index.tsx', but '--jsx' is not set.
^^^^^^^^^^^^^^^^^^^^^^^
I found that it was because the specified tsconfig path was not passed to rollup-plugin-dts, so rollup-plugin-dts used the root path's tsconfig.json by default
Just pass the specified tsconfig path to rollup-plugin-dts to fix this problem.
Problem
dts
does not correctly generate types fortsx
files when using a specifictsconfig
.run command
https://github.com/privatenumber/pkgroll/blob/2a988e454bd8fd163b567e5fa2e67ab89864c3f3/src/utils/get-rollup-configs.ts#L61
Expected behavior
I found that it was because the specified tsconfig path was not passed to
rollup-plugin-dts
, sorollup-plugin-dts
used the root path'stsconfig.json
by defaultJust pass the specified
tsconfig
path torollup-plugin-dts
to fix this problem.Minimal reproduction URL
https://stackblitz.com/edit/stackblitz-starters-ayudec
Version
v2.5.0
Node.js version
v22.6.0
Package manager
pnpm
Operating system
macOS
Bugs are expected to be fixed by those affected by it
Compensating engineering work financially will speed up resolution