* Verifies that a wasm loading type has been enabled before code generation * attempts to use it. * @param {Compiler} compiler the compiler instance * @param {WasmLoadingType} type type of library * @returns {void}
(compiler, type)
| 63 | * @returns {void} |
| 64 | */ |
| 65 | static checkEnabled(compiler, type) { |
| 66 | if (!getEnabledTypes(compiler).has(type)) { |
| 67 | throw new Error( |
| 68 | `Library type "${type}" is not enabled. ` + |
| 69 | "EnableWasmLoadingPlugin need to be used to enable this type of wasm loading. " + |
| 70 | 'This usually happens through the "output.enabledWasmLoadingTypes" option. ' + |
| 71 | 'If you are using a function as entry which sets "wasmLoading", you need to add all potential library types to "output.enabledWasmLoadingTypes". ' + |
| 72 | `These types are enabled: ${[...getEnabledTypes(compiler)].join(", ")}` |
| 73 | ); |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * Enables the requested wasm loading backend once and applies the |
nothing calls this directly
no test coverage detected