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.code for missing output.name of IIFE bundle that has export #3372
Conversation
writing test |
Codecov Report
@@ Coverage Diff @@
## master #3372 +/- ##
=======================================
Coverage 93.29% 93.29%
=======================================
Files 172 172
Lines 6114 6114
Branches 1823 1823
=======================================
Hits 5704 5704
Misses 218 218
Partials 192 192
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A code should definitely be added, but I think it should be aligned with the corresponding error for UMD bundles 'You must supply "output.name" for UMD bundles.'
, because it is about the same issue. This one is using INVALID_OPTION
, though, which I am not really happy about as not passing a name
IS valid if there are no exports. Would you consider changing the code in umd.ts
to MISSING_NAME_FOR_EXPORT
? You might also slightly tune the error message, e.g. You must supply "output.name" for UMD bundles that have exports.
@lukastaegert Then, should IIFE bundles also publish error, instead of warning? |
You are somewhat right about the breaking change. Maybe we should make a separate PR for changing the error code to the
If it produces working code, no reason to make it an error IMO. It's always possible someone depends on this... |
Sorry for late reply. I was under busy. |
Let's wait how the discussion in #3393 pans out before merging |
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Description
Hi, I'm using rollup with typescript.
In my project, there are some modules built as iife, because they must assign some object into
window
when loaded .But it also has
export
since its member's type definition was used by other modules.In this case, rollup will warn that bundle is missing output.name.
This is request to add warn.code, useful for suppress by
onwarn()
.