cobalt-ui icon indicating copy to clipboard operation
cobalt-ui copied to clipboard

Wonky bundling

Open mrginglymus opened this issue 1 month ago • 2 comments

There's some severe wonkiness with the bundling.

By default, rolldown will bundle everything. This means that deps declared under dependencies are being bundled, but still also being downloaded as dependencies. e.g. @terrazzo/token-tools is a prod dependency of @terrazzo/plugin-css, but is also inlined in the bundle.

Secondly, the the typescript stubs for @terrazzo/plugin-css include public types from @terrazzo/parser, which is not included in dependencies and therefore relies on hoisting to be resolved correctly.

mrginglymus avatar Nov 22 '25 13:11 mrginglymus

Great catch! I’m a little embarrassed I didn’t notice this. Yes any/all improvements here are welcome (and we can also open issues on Rolldown too. Rollup did do a better job of prompting for externals)

drwpow-figma avatar Nov 22 '25 17:11 drwpow-figma

Rollup did do a better job of prompting for externals

Yes rolldowns default behaviour of "Oh I couldn't find this it's probably fine" is...somewhat surprising!

mrginglymus avatar Nov 22 '25 18:11 mrginglymus