* Entry description to options. * @param {Compiler} compiler the compiler * @param {string} name entry name * @param {EntryDescription} desc entry description * @returns {EntryOptions} options for the entry
(compiler, name, desc)
| 101 | * @returns {EntryOptions} options for the entry |
| 102 | */ |
| 103 | static entryDescriptionToOptions(compiler, name, desc) { |
| 104 | /** @type {EntryOptions} */ |
| 105 | const options = { |
| 106 | name, |
| 107 | filename: desc.filename, |
| 108 | runtime: desc.runtime, |
| 109 | layer: desc.layer, |
| 110 | dependOn: desc.dependOn, |
| 111 | baseUri: desc.baseUri, |
| 112 | publicPath: desc.publicPath, |
| 113 | chunkLoading: desc.chunkLoading, |
| 114 | asyncChunks: desc.asyncChunks, |
| 115 | wasmLoading: desc.wasmLoading, |
| 116 | worker: desc.worker, |
| 117 | library: desc.library |
| 118 | }; |
| 119 | if (desc.chunkLoading) { |
| 120 | const EnableChunkLoadingPlugin = require("./javascript/EnableChunkLoadingPlugin"); |
| 121 | |
| 122 | EnableChunkLoadingPlugin.checkEnabled(compiler, desc.chunkLoading); |
| 123 | } |
| 124 | if (desc.wasmLoading) { |
| 125 | const EnableWasmLoadingPlugin = require("./wasm/EnableWasmLoadingPlugin"); |
| 126 | |
| 127 | EnableWasmLoadingPlugin.checkEnabled(compiler, desc.wasmLoading); |
| 128 | } |
| 129 | if (desc.library) { |
| 130 | const EnableLibraryPlugin = require("./library/EnableLibraryPlugin"); |
| 131 | |
| 132 | EnableLibraryPlugin.checkEnabled(compiler, desc.library.type); |
| 133 | } |
| 134 | return options; |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | module.exports = EntryOptionPlugin; |
no test coverage detected