New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose module and bundle exports from hooks #4721
Comments
Basically like what we have on chunks, i.e. If the module does an I would definitely be open to good proposals and PRs here. Maybe it could also make sense to differentiate between exports and re-exports (something like |
Then we should limit it to "inline" exports that have no dependencies. I don't know what the correct naming for those exports would be (local exports maybe).
Parsing of the AST should be done to analyse if the export declaration contains a value in the same file. Something similar to what Nextjs is doing here. Thanks for your comment, hopefully more people become interested in this. I see so many benefits on adding this and it would add so much value for plugin writers for rollup. |
Maybe something like this:
|
This comment was marked as off-topic.
This comment was marked as off-topic.
This issue has been resolved via #4731 as part of rollup@3.6.0. You can test it via |
Feature Use Case
Easier to write plugins that access a module's exports, for example:
Of course this is just an easy example and not supposed to be something meaningful. I can imagine many use cases of plugins that one could develop accessing a module's exports.
Feature Proposal
Expose a module's and bundles exports in hooks as an object that you can access.
The text was updated successfully, but these errors were encountered: