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

Function resolveId

packages/vite/src/node/server/__tests__/pluginContainer.spec.ts:17–25  ·  view source on GitHub ↗
(id)

Source from the content-addressed store, hash-verified

15 const plugin: Plugin = {
16 name: 'p1',
17 resolveId(id) {
18 if (id === entryUrl) {
19 // The module hasn't been resolved yet, so its info is null.
20 const moduleInfo = this.getModuleInfo(entryUrl)
21 expect(moduleInfo).toEqual(null)
22
23 return { id, meta: { x: 1 } }
24 }
25 },
26 load(id) {
27 if (id === entryUrl) {
28 const { meta } = this.getModuleInfo(entryUrl) ?? {}

Callers

nothing calls this directly

Calls 2

resolveMethod · 0.65
getModuleInfoMethod · 0.45

Tested by

no test coverage detected