Closed AndreiLucas123 closed 1 year ago
I'm investigating a fix for this. I can confirm that by the time the code reaches renderChunk
the code is failing: https://github.com/Swatinem/rollup-plugin-dts/blob/master/src/transform/index.ts#L96
However, preprocessed
code is fine (no transformation of this
) at this point: https://github.com/Swatinem/rollup-plugin-dts/blob/master/src/transform/index.ts#L81
And fine at the parse
step: https://github.com/Swatinem/rollup-plugin-dts/blob/master/src/transform/index.ts#L83
Using this process of elimination, I'm gonna start investigating into the convert
function: https://github.com/Swatinem/rollup-plugin-dts/blob/master/src/transform/index.ts#L84
I've opened a pull request that seems to solve this issue here:
Checklist
node-resolve
are known to cause issues..d.ts
files generated by TypeScript. The plugin can consume.ts
and even.js
files (withallowJs: true
), but this is known to cause issues.@types
. The plugin ignores these by default, unlessrespectExternal
is set.@types
can contain hand-crafted code which is known to cause issues.Code Before
Code After
There are no error messages, what is happening is typeof this; is becaming typeof this$1; for some weird reason
My rollup config
My temporary sollution
Created by ChatGPT