* Checks enabled. * @param {Compiler} compiler the compiler instance * @param {LibraryType} type type of library * @returns {void}
(compiler, type)
| 64 | * @returns {void} |
| 65 | */ |
| 66 | static checkEnabled(compiler, type) { |
| 67 | if (!getEnabledTypes(compiler).has(type)) { |
| 68 | throw new Error( |
| 69 | `Library type "${type}" is not enabled. ` + |
| 70 | "EnableLibraryPlugin need to be used to enable this type of library. " + |
| 71 | 'This usually happens through the "output.enabledLibraryTypes" option. ' + |
| 72 | 'If you are using a function as entry which sets "library", you need to add all potential library types to "output.enabledLibraryTypes". ' + |
| 73 | `These types are enabled: ${[...getEnabledTypes(compiler)].join(", ")}` |
| 74 | ); |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | /** |
| 79 | * Applies the plugin by registering its hooks on the compiler. |
no test coverage detected