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

Function resolvePath

packages/vite/src/node/optimizer/scan.ts:218–233  ·  view source on GitHub ↗
(p: string)

Source from the content-addressed store, hash-verified

216 entries = await globEntries(explicitEntryPatterns, environment)
217 } else if (buildInput) {
218 const resolvePath = async (p: string) => {
219 // `build.rollupOptions.input` is resolved from the root (not `process.cwd()`)
220 // by the build, so resolve it from the root here too by not passing an importer.
221 const id = (
222 await environment.pluginContainer.resolveId(p, undefined, {
223 isEntry: true,
224 scan: true,
225 })
226 )?.id
227 if (id === undefined) {
228 throw new Error(
229 `failed to resolve rolldownOptions.input value: ${JSON.stringify(p)}.`,
230 )
231 }
232 return id
233 }
234 if (typeof buildInput === 'string') {
235 entries = [await resolvePath(buildInput)]
236 } else if (Array.isArray(buildInput)) {

Callers 1

computeEntriesFunction · 0.70

Calls 1

resolveIdMethod · 0.45

Tested by

no test coverage detected