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

Function compilerResolveOf

ark/aot/unplugin.ts:3058–3072  ·  view source on GitHub ↗
(compiler: BundlerCompiler)

Source from the content-addressed store, hash-verified

3056// resolves what the precompiler can't, as the compiler resolves a module's
3057// import, where no loader is running to ask
3058const compilerResolveOf = (compiler: BundlerCompiler): BundlerResolve => {
3059 const resolver = compiler.resolverFactory.get("normal", {
3060 // webpack's and Rspack's
3061 dependencyType: "esm",
3062 dependencyCategory: "esm"
3063 })
3064 return async (specifier, importer) =>
3065 ownSpecifier.test(specifier) ? undefined : (
3066 new Promise(done =>
3067 resolver.resolve({}, dirname(importer), specifier, {}, (error, path) =>
3068 done((!error && path) || undefined)
3069 )
3070 )
3071 )
3072}
3073
3074// webpack and Rspack build for production where no mode is set
3075const environmentOf = (compiler: BundlerCompiler): Environment => ({

Callers 1

answerBuiltFunction · 0.85

Calls 4

doneFunction · 0.85
testMethod · 0.80
getMethod · 0.65
resolveMethod · 0.65

Tested by

no test coverage detected