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
Catch invalid options.format values #2813
Conversation
Okay, yeah, see my PR #2814 wrt to the failing CI run. |
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.
Looks technically ok to me except that internally, 'esm' is actually mapped to 'es' so you should check for that instead (which is why so many tests are breaking). The reason is that this is what was used by plugins before we changed to 'esm' .
The error message may be misleading but it correctly lists the currently recommended alias 'esm' (though there is a chance we will switch to 'module' in the future)
Before, it'd nebulously crash when trying to dereference RESERVED_NAMES_BY_FORMAT instead. (It'd be nice if the formats were centrally defined, but since they aren't I decided to just add another list.)
I can't get the tests to pass either way (a lot of them time out) locally, so I've force-pushed just to see what the CI makes of it. |
Seems that CI likes it! |
@@ -34,7 +34,7 @@ function checkOutputOptions(options: OutputOptions) { | |||
}); | |||
} | |||
|
|||
if (!options.format) { | |||
if (['amd', 'cjs', 'system', 'es', 'iife', 'umd'].indexOf(options.format) < 0) { |
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.
You forgot esm
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.
Never mind. I saw Lukas comment
Before, it'd nebulously crash when trying to dereference
RESERVED_NAMES_BY_FORMAT
instead.(It'd be nice if the formats were centrally defined, but since they aren't I decided to just add another list.)
This PR contains:
Are tests included?
Breaking Changes?