( url: string, config: ResolvedConfig, )
| 392 | export const publicAssetUrlRE: RegExp = /__VITE_PUBLIC_ASSET__([a-z\d]{8})__/g |
| 393 | |
| 394 | export function publicFileToBuiltUrl( |
| 395 | url: string, |
| 396 | config: ResolvedConfig, |
| 397 | ): string { |
| 398 | if (config.command !== class="st">'build') { |
| 399 | class="cm">// We don't need relative base or renderBuiltUrl support during dev |
| 400 | return joinUrlSegments(config.decodedBase, url) |
| 401 | } |
| 402 | const hash = getHash(url) |
| 403 | let cache = publicAssetUrlCache.get(config) |
| 404 | if (!cache) { |
| 405 | cache = new Map<string, string>() |
| 406 | publicAssetUrlCache.set(config, cache) |
| 407 | } |
| 408 | if (!cache.get(hash)) { |
| 409 | cache.set(hash, url) |
| 410 | } |
| 411 | return `__VITE_PUBLIC_ASSET__${hash}__` |
| 412 | } |
| 413 | |
| 414 | const GIT_LFS_PREFIX = Buffer.from(class="st">'version https:class="cm">//git-lfs.github.com') |
| 415 | function isGitLfsPlaceholder(content: Buffer): boolean { |
no test coverage detected