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

Function toOutputFilePathInJSForBundledDev

packages/vite/src/node/plugins/asset.ts:491–510  ·  view source on GitHub ↗
(
  environment: PartialEnvironment,
  filename: string,
)

Source from the content-addressed store, hash-verified

489}
490
491export function toOutputFilePathInJSForBundledDev(
492 environment: PartialEnvironment,
493 filename: string,
494): string {
495 const outputUrl = toOutputFilePathInJS(
496 environment,
497 filename,
498 'asset',
499 // in bundled dev, the chunks are always emitted to `assets` directory
500 'assets/dummy.js',
501 'js',
502 // relative base is not supported in bundled dev
503 () => {
504 throw new Error('unreachable')
505 },
506 )
507 // renderBuiltUrl is not supported in bundled dev
508 if (typeof outputUrl === 'object') throw new Error('unreachable')
509 return outputUrl
510}
511
512export async function urlToBuiltUrl(
513 pluginContext: PluginContext,

Callers 3

handlerFunction · 0.90
handlerFunction · 0.90
fileToBuiltUrlFunction · 0.85

Calls 1

toOutputFilePathInJSFunction · 0.90

Tested by

no test coverage detected