Skip to content

Commit

Permalink
AssignLibraryPlugin: improve error message for invalid library name
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 authored and sokra committed Jan 18, 2021
1 parent ed60667 commit b5b62c4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/library/AssignLibraryPlugin.js
Expand Up @@ -120,11 +120,13 @@ class AssignLibraryPlugin extends AbstractLibraryPlugin {
const { name } = library;
if (this.unnamed === "error") {
if (typeof name !== "string" && !Array.isArray(name)) {
throw new Error("Library name must be a string or string array");
throw new Error("output.library.name must be a string or string array");
}
} else {
if (name && typeof name !== "string" && !Array.isArray(name)) {
throw new Error("Library name must be a string, string array or unset");
throw new Error(
"output.library.name must be a string, string array or unset"
);
}
}
return {
Expand Down

0 comments on commit b5b62c4

Please sign in to comment.