(resolved: PartialResolvedId)
| 767 | } |
| 768 | |
| 769 | const processResult = (resolved: PartialResolvedId) => { |
| 770 | if (!externalize) { |
| 771 | return resolved |
| 772 | } |
| 773 | if (!canExternalizeFile(resolved.id)) { |
| 774 | return resolved |
| 775 | } |
| 776 | |
| 777 | let resolvedId = id |
| 778 | if ( |
| 779 | deepMatch && |
| 780 | !pkg.data.exports && |
| 781 | path.extname(id) !== path.extname(resolved.id) |
| 782 | ) { |
| 783 | // id date-fns/locale |
| 784 | // resolve.id ...date-fns/esm/locale/index.js |
| 785 | const index = resolved.id.indexOf(id) |
| 786 | if (index > -1) { |
| 787 | resolvedId = resolved.id.slice(index) |
| 788 | debug?.( |
| 789 | `[processResult] ${colors.cyan(id)} -> ${colors.dim(resolvedId)}`, |
| 790 | ) |
| 791 | } |
| 792 | } |
| 793 | return { ...resolved, id: resolvedId, external: true } |
| 794 | } |
| 795 | |
| 796 | if (!options.idOnly && ((!options.scan && isBuild) || externalize)) { |
| 797 | // Resolve package side effects for build so that rollup can better |
no test coverage detected