Open megastels opened 2 years ago
I've been seeing the same issue for a while; thanks for providing the reproduction example, @megastels! I reckon this was caused by https://github.com/wessberg/rollup-plugin-ts/commit/16d24fa1660d581b0e93d1566ef9dea2dc8fd179
I'd love to see this addressed :-) Happy to help too, but not sure how much time I'll have in the coming weeks.
@wessberg I managed to add a test case with the above example; as expected, it fails. However, I'm unsure where to continue - all my console.log
s are being swallowed when running the tests, for example :smile: . Any pointers?
Came here to report this myself. Slightly different but similar scenario, and likely the same root cause. This is a pretty significant gap imho. Exporting default symbols is a very common use case.
In my case: entry point:
export * from './colors';
export { default as ThemePalette } from './ThemePalette';
export * from './darkThemePalette';
export * from './lightThemePalette';
The bottom three work (even the default as ThemePalette
, but the index.ts
in the ./colors
folder has a bunch more default exports, and those all end up broken.
/** colors/index.ts */
export { default as TonalPalette } from './TonalPalette';
export { default as common } from './common';
export { default as aqua } from './aqua';
export { default as blue } from './blue';
export { default as gray } from './gray';
export { default as grey } from './gray';
export { default as green } from './green';
export { default as orange } from './orange';
export { default as purple } from './purple';
export { default as red } from './red';
export { default as yellow } from './yellow';
Those all end up like this in the rolled up .d.ts
:
export { default as TonalPalette, default as common, default as aqua, default as blue, default as gray, default as grey, default as green, default as orange, default as purple, default as red, default as yellow, ThemePalette, darkThemePalette, lightThemePalette };
I've hit this too. Is there a workaround?
also hit this, am being told the answer is to abandon this and rollup for vite and vite-plugin-ts ðŸ˜
Also, hit this, Is there a walkaround now?
Also, hit this, Is there a walkaround now?
This may not be the most helpful answer, but i ultimately switched to the official TS plugin for rollup: @rollup/plugin-typescript
(README). It did everything i needed, and was easy to swap in. This project looks to be abandoned.
I just switched torollup-plugin-dts
for the definition files. I still use rollup-plugin-ts for the JS files, though.
plugin generates broken declarations
Reproduction
Simple example
A.ts
B.ts
entry point
config
Expected Behavior
Actual Behavior