warn.code for missing output.name of IIFE bundle that has export#3372
warn.code for missing output.name of IIFE bundle that has export#3372lukastaegert merged 5 commits intorollup:masterfrom
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.
|
lukastaegert
left a comment
There was a problem hiding this comment.
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
windowwhen loaded .But it also has
exportsince 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().