( bundle: BundleModules, warn = (message: string) => console.warn(message), noExternal?: string )
| 449 | // tsup and tsdown leave dependencies external through a plugin of their |
| 450 | // own, which only the bundle shows |
| 451 | const checkBundledExternals = async ( |
| 452 | bundle: BundleModules, |
| 453 | warn = (message: string) => console.warn(message), |
| 454 | noExternal?: string |
| 455 | ) => { |
| 456 | if (!isStandalone || opts?.shadow) return |
| 457 | const specifier = unsharedExternalOf(bundle) |
| 458 | const problem = |
| 459 | specifier ? |
| 460 | writeBundledExternalMessage(specifier) |
| 461 | : await bundledDependentProblemOf(bundle, noExternal) |
| 462 | if (!problem) return |
| 463 | if (opts?.allowUnsafe) warn(problem) |
| 464 | else throwBuildError(withAllowUnsafe(problem)) |
| 465 | } |
| 466 | const bundledDependentProblemOf = async ( |
| 467 | bundle: BundleModules, |
| 468 | noExternal: string | undefined |
no test coverage detected