Skip to content

Commit

Permalink
Catch invalid options.format values (#2813)
Browse files Browse the repository at this point in the history
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.)
  • Loading branch information
marijnh authored and lukastaegert committed Apr 19, 2019
1 parent a5e33e3 commit 099444d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rollup/index.ts
Expand Up @@ -34,7 +34,7 @@ function checkOutputOptions(options: OutputOptions) {
});
}

if (!options.format) {
if (['amd', 'cjs', 'system', 'es', 'iife', 'umd'].indexOf(options.format) < 0) {
error({
message: `You must specify "output.format", which can be one of "amd", "cjs", "system", "esm", "iife" or "umd".`,
url: `https://rollupjs.org/guide/en#output-format`
Expand Down

0 comments on commit 099444d

Please sign in to comment.