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

Function resolveOutputJsExtension

packages/vite/src/node/build.ts:985–994  ·  view source on GitHub ↗
(
  format: ModuleFormat,
  type: string = 'commonjs',
)

Source from the content-addressed store, hash-verified

983type JsExt = 'js' | 'cjs' | 'mjs'
984
985function resolveOutputJsExtension(
986 format: ModuleFormat,
987 type: string = 'commonjs',
988): JsExt {
989 if (type === 'module') {
990 return format === 'cjs' || format === 'umd' ? 'cjs' : 'js'
991 } else {
992 return format === 'es' ? 'mjs' : 'js'
993 }
994}
995
996export function resolveLibFilename(
997 libOptions: LibraryOptions,

Callers 2

buildOutputOptionsFunction · 0.85
resolveLibFilenameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected