rollup / rollup-plugin-commonjs

This module has moved and is now available at @rollup/plugin-commonjs / https://github.com/rollup/plugins/blob/master/packages/commonjs
MIT License
502 stars 126 forks source link

WIP: Support type information (*.d.ts). #357

Closed RebeccaStevens closed 4 years ago

RebeccaStevens commented 6 years ago

The PR makes it so type information is used when available.

This helps avoid Error: "[name] is not exported by [module]".

This PR probably isn't perfect as there are many test cases not being test yet. Further work will be required but I'd like to get some feedback on it in the meantime.

Todo:

Plus more...

guybedford commented 6 years ago

Very interesting approach! This is one of those things that seems like it should just be this way.

My biggest concern would be adding to the package install size / computation work going on when using this plugin. Perhaps there might be ways to mitigate that - eg making it an optional dependency and a flag for example.

We're all pretty busy, with none of us having much dedicated time for Rollup, so review will take a little while, but hopefully one of us will provide a proper review when we can.

shellscape commented 4 years ago

@RebeccaStevens thanks for your work on this. We're getting ready to move the plugin to a new home at https://github.com/rollup/plugins and we'd welcome seeing this approach fleshed out some more there.