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

Function createResolver

packages/vite/src/node/config.ts:2058–2073  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

2056 getSortedPluginHooks: undefined!,
2057
2058 createResolver(options) {
2059 const resolve = createIdResolver(this, options)
2060 const clientEnvironment = new PartialEnvironment('client', this)
2061 let ssrEnvironment: PartialEnvironment | undefined
2062 return async (id, importer, aliasOnly, ssr) => {
2063 if (ssr) {
2064 ssrEnvironment ??= new PartialEnvironment('ssr', this)
2065 }
2066 return await resolve(
2067 ssr ? ssrEnvironment! : clientEnvironment,
2068 id,
2069 importer,
2070 aliasOnly,
2071 )
2072 }
2073 },
2074 fsDenyGlob: picomatch(
2075 // matchBase: true does not work as it's documented
2076 // https://github.com/micromatch/picomatch/issues/89

Callers

nothing calls this directly

Calls 2

createIdResolverFunction · 0.90
resolveFunction · 0.70

Tested by

no test coverage detected