(
{ moduleGraph: graph }: BundlerCompilation,
written: readonly BuiltBundlerModule[]
)
| 2213 | // keeps from happening unless webpack comes to defer them otherwise. Nothing |
| 2214 | // else would say so, and the read would find it undefined |
| 2215 | const unbuiltReadOf = ( |
| 2216 | { moduleGraph: graph }: BundlerCompilation, |
| 2217 | written: readonly BuiltBundlerModule[] |
| 2218 | ): [file: string, name: string] | undefined => { |
| 2219 | for (const module of written) { |
| 2220 | const unbuilt = module.dependencies.flatMap(dependency => |
| 2221 | ( |
| 2222 | typeof dependency.name === "string" && |
| 2223 | dependency.request !== undefined && |
| 2224 | !graph.getModule(dependency as never) |
| 2225 | ) ? |
| 2226 | dependency.name |
| 2227 | : [] |
| 2228 | ) |
| 2229 | if (!unbuilt.length) continue |
| 2230 | const asked = namesAskedOf(graph, module) |
| 2231 | const read = unbuilt.find(name => asked === true || asked.has(name)) |
| 2232 | if (read) return [fileOf(module.resource!), read] |
| 2233 | } |
| 2234 | } |
| 2235 | |
| 2236 | // a request like `-!loader!./file` runs only the loader it names, so nothing the |
| 2237 | // plugin writes of it reaches the bundle, which reads it as it was built |
no test coverage detected