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

Function toRelativePath

packages/vite/src/node/plugins/importAnalysisBuild.ts:37–40  ·  view source on GitHub ↗
(filename: string, importer: string)

Source from the content-addressed store, hash-verified

35const preloadMarkerRE = new RegExp(preloadMarker, 'g')
36
37function toRelativePath(filename: string, importer: string) {
38 const relPath = path.posix.relative(path.posix.dirname(importer), filename)
39 return relPath[0] === '.' ? relPath : `./${relPath}`
40}
41
42function findPreloadMarker(str: string, pos: number = 0): number {
43 preloadMarkerRE.lastIndex = pos

Callers 2

generateBundleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected