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
Warn when implicitly using default export mode #3659
Conversation
Thank you for your contribution! ❤️You can try out this pull request locally by installing Rollup via
or load it into the REPL: |
Codecov Report
@@ Coverage Diff @@
## master #3659 +/- ##
==========================================
+ Coverage 96.71% 96.77% +0.05%
==========================================
Files 183 183
Lines 6303 6294 -9
Branches 1835 1834 -1
==========================================
- Hits 6096 6091 -5
Misses 105 105
+ Partials 102 98 -4
Continue to review full report at Codecov.
|
995d0f9
to
44b13a2
Compare
Just a short question on this behaviour: I am using Sapper and updated to rollup@2.22.1 - then was confronted with the warning you introduced. Thanks in advice and sorry if I am misunderstanding something about this... |
There should not be a warning about the config itself, but I do not think Rollup is transpiling the config here but must be called by sapper somehow. If I remember correctly, Rollup CLI is internally using named exports mode for the config, so I guess this must be in how sapper handles things. I would recommend asking there first. |
Found the problem, sapper indeed uses the API functions For anyone coming across this problem, I submitted a Sapper PR: sveltejs/sapper#1331 |
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
rollup/plugins#481
Description
This adds a warning when not explicitly specifying a value for
output.exports
when generating CommonJS output and only a default export is present:As the warning also contains a link to the URL of the output.exports documentation, this one has been extended as well to give a little more context.
This is to encourage moving away from default export mode in CommonJS as it is the source of many interop problems, see rollup/plugins#481