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

Function htmlFileToUrl

packages/vite/src/node/server/warmup.ts:55–61  ·  view source on GitHub ↗
(file: string, root: string)

Source from the content-addressed store, hash-verified

53}
54
55function htmlFileToUrl(file: string, root: string) {
56 const url = path.relative(root, file)
57 // out of root, ignore file
58 if (url[0] === '.') return
59 // file within root, create root-relative url
60 return '/' + normalizePath(url)
61}
62
63function fileToUrl(file: string, root: string) {
64 const url = path.relative(root, file)

Callers 1

warmupFileFunction · 0.85

Calls 1

normalizePathFunction · 0.90

Tested by

no test coverage detected