Skip to content

Function: xmBuildOutputFile()

API / @xmachines/shared / vite-aliases / xmBuildOutputFile

function xmBuildOutputFile(packageDir, sourceFile): string;

Defined in: vite-aliases.ts:359

The file in dist/ that the build writes for one source file of a package.

The library build keeps the module structure (preserveModules, with src/ as the root), and tsc writes the same layout. So src/a/b.ts becomes dist/a/b.js. A .tsx, .vue or .svelte file becomes .js too. A runes module x.svelte.ts becomes x.js: the build of play-svelte drops the infix, because a consumer’s Svelte plugin compiles each *.svelte.js again (see packages/play-svelte/vite.config.ts).

Parameters

ParameterTypeDescription
packageDirstringThe package directory.
sourceFilestringAn absolute path under <packageDir>/src/.

Returns

string