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

Function processAssetUrl

packages/vite/src/node/plugins/html.ts:515–530  ·  view source on GitHub ↗
(url: string, shouldInline?: boolean)

Source from the content-addressed store, hash-verified

513 config.build.rolldownOptions.input || {},
514 )
515 const processAssetUrl = async (url: string, shouldInline?: boolean) => {
516 if (
517 url !== '' && // Empty attribute
518 !namedOutput.includes(url) && // Direct reference to named output
519 !namedOutput.includes(removeLeadingSlash(url)) // Allow for absolute references as named output can't be an absolute path
520 ) {
521 try {
522 return await urlToBuiltUrl(this, url, id, shouldInline)
523 } catch (e) {
524 if (e.code !== 'ENOENT') {
525 throw e
526 }
527 }
528 }
529 return url
530 }
531
532 const setModuleSideEffectPromises: Promise<void>[] = []
533 await traverseHtml(html, id, config.logger.warn, (node) => {

Callers 1

handlerFunction · 0.85

Calls 2

removeLeadingSlashFunction · 0.90
urlToBuiltUrlFunction · 0.90

Tested by

no test coverage detected