property metafile | Bun module | Bun
BuildDocsReferenceGuidesBlogDiscord/
Bun/
BuildConfig/
metafilePmetafile
Search the reference...
/
BuildDocsReferenceGuidesBlogDiscord/
Bun/
BuildConfig/
metafilePmetafile
property
BuildConfig.metafilemetafile?: boolean
Generate a JSON file containing metadata about the build.
The metafile contains information about inputs, outputs, imports, and exports which can be used for bundle analysis, visualization, or integration with other tools.
When true, the metafile JSON string is included in the BuildOutput.metafile property.
const result = await Bun.build({
entrypoints: ['./src/index.ts'],
outdir: './dist',
metafile: true,
});
// Write metafile to disk for analysis
if (result.metafile) {
await Bun.write('./dist/meta.json', result.metafile);
}
// Parse and analyze the metafile
const meta = JSON.parse(result.metafile!);
console.log('Input files:', Object.keys(meta.inputs));
console.log('Output files:', Object.keys(meta.outputs));
Resources
ReferenceDocsGuidesDiscordMerch StoreGitHubBlog Toolkit
RuntimePackage managerTest runnerBundlerPackage runnerProject
Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseBaked with ❤️ in San Francisco
We're hiring →