MCPcopy Create free account
hub / github.com/arktypeio/arktype / resolveUnloaded

Function resolveUnloaded

ark/aot/unplugin.ts:2733–2748  ·  view source on GitHub ↗
(
	context: RollupContext,
	specifier: string,
	importer: string | undefined,
	isTransformed: (id: string) => boolean,
	options?: { skipSelf?: boolean }
)

Source from the content-addressed store, hash-verified

2731// resolved as a require, which Rollup's CommonJS plugin leaves to the others,
2732// so no load runs a transform waiting on the scan
2733const resolveUnloaded = async (
2734 context: RollupContext,
2735 specifier: string,
2736 importer: string | undefined,
2737 isTransformed: (id: string) => boolean,
2738 options?: { skipSelf?: boolean }
2739): Promise<RollupResolution | null> => {
2740 const required = await context.resolve(specifier, importer, {
2741 ...options,
2742 ...asRequired
2743 })
2744 // a package may export another module to a require, so a dependency is resolved again
2745 return !required || required.external || isTransformed(required.id) ?
2746 required
2747 : context.resolve(specifier, importer, options)
2748}
2749
2750// null where no bundle holds it: it's external, or a plugin refuses it, as
2751// React Router refuses a .server module in the client build

Callers 2

bundlerResolveOfFunction · 0.85
bundledResolutionOfFunction · 0.85

Calls 2

isTransformedFunction · 0.70
resolveMethod · 0.65

Tested by

no test coverage detected