MCPcopy
hub / github.com/vitejs/vite / processResult

Function processResult

packages/vite/src/node/plugins/resolve.ts:769–794  ·  view source on GitHub ↗
(resolved: PartialResolvedId)

Source from the content-addressed store, hash-verified

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

Callers 1

tryNodeResolveFunction · 0.85

Calls 1

canExternalizeFileFunction · 0.90

Tested by

no test coverage detected