(item)
| 110 | if (!externals) return requests; |
| 111 | /** @param {import("../../declarations/WebpackOptions").ExternalItem} item one item */ |
| 112 | const visit = (item) => { |
| 113 | if (typeof item === "string") { |
| 114 | requests.add(item); |
| 115 | return; |
| 116 | } |
| 117 | if (!item || typeof item !== "object" || item instanceof RegExp) return; |
| 118 | const resolved = /** @type {Record<string, unknown>} */ ( |
| 119 | resolveByProperty( |
| 120 | /** @type {Record<string, unknown>} */ (item), |
| 121 | "byLayer", |
| 122 | layer |
| 123 | ) |
| 124 | ); |
| 125 | for (const [request, value] of Object.entries(resolved)) { |
| 126 | // `false` explicitly opts the request out of externalization; reserving |
| 127 | // it would pull the actual module into the entry chunk. |
| 128 | if (value === false) continue; |
| 129 | requests.add(request); |
| 130 | } |
| 131 | }; |
| 132 | if (Array.isArray(externals)) { |
| 133 | for (const item of externals) visit(item); |
| 134 | } else { |
no test coverage detected