(code, id)
| 1074 | code: /\bimport\b/ |
| 1075 | }, |
| 1076 | async handler(code, id) { |
| 1077 | const isOwn = |
| 1078 | transformedFilter.include.test(id) && |
| 1079 | !transformedFilter.exclude.test(id) |
| 1080 | // webpack and Rspack say what they built, and a query there may |
| 1081 | // name a script |
| 1082 | const built = ( |
| 1083 | this.getNativeBuildContext?.() as NativeBuild | undefined |
| 1084 | )?.loaderContext?._module |
| 1085 | const isInert = built ? !isScriptModule(built) : isAsset(id) |
| 1086 | // read once the bundle is built, against what its scan wrote |
| 1087 | if (!isOwn && !isInert) |
| 1088 | othersByBuild.get(buildOf(this))?.set(fileOf(id), code) |
| 1089 | if (!isStandalone || opts?.shadow || isOwn || isInert) return |
| 1090 | const map = ( |
| 1091 | this as { getCombinedSourcemap?: () => { mappings: string } } |
| 1092 | ).getCombinedSourcemap?.() |
| 1093 | reportDiagnostics( |
| 1094 | (await requestResolving( |
| 1095 | bundlerResolveOf(this, isTransformedId), |
| 1096 | "checkUnwritten", |
| 1097 | code, |
| 1098 | fileOf(id), |
| 1099 | map?.mappings |
| 1100 | )) as RenderedDiagnostics, |
| 1101 | warning => this.warn(warning), |
| 1102 | throwBuildError |
| 1103 | ) |
| 1104 | } |
| 1105 | } |
| 1106 | } |
| 1107 | // Vitest's, which Vite's Plugin type declares only where Vitest is installed |
no test coverage detected