(id, importer, options)
| 171 | resolveId: { |
| 172 | filter: { id: allExternalTypesReg }, |
| 173 | async handler(id, importer, options) { |
| 174 | const kind = options.kind |
| 175 | // if the prefix exist, it is already converted to `import`, so set `external: true` |
| 176 | if (id.startsWith(convertedExternalPrefix)) { |
| 177 | return { |
| 178 | id: id.slice(convertedExternalPrefix.length), |
| 179 | external: 'absolute', |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | const resolved = await resolve(id, importer, kind) |
| 184 | if (resolved) { |
| 185 | // `resolved` can be javascript even when `id` matches `allExternalTypes` |
| 186 | // due to cjs resolution (e.g. require("./test.pdf") for "./test.pdf.js") |
| 187 | // or package name (e.g. import "some-package.pdf") |
| 188 | if (JS_TYPES_RE.test(resolved)) { |
| 189 | return { |
| 190 | // normalize to \\ on windows for esbuild/rolldown behavior difference: https://github.com/sapphi-red-repros/rolldown-esbuild-path-normalization |
| 191 | id: isWindows ? resolved.replaceAll('/', '\\') : resolved, |
| 192 | external: false, |
| 193 | } |
| 194 | } |
| 195 | return resolveAssets(resolved, kind) |
| 196 | } |
| 197 | }, |
| 198 | }, |
| 199 | load: { |
| 200 | filter: { |
nothing calls this directly
no test coverage detected