温馨提示:本站仅提供公开网络链接索引服务,不存储、不篡改任何第三方内容,所有内容版权归原作者所有
AI智能索引来源:http://www.bun.com/reference/bun/BuildConfig/files
点击访问原文链接

property files | Bun module | Bun

property files | Bun module | BunBuildDocsReferenceGuidesBlogDiscord/Bun/BuildConfig/filesPfiles

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/Bun/BuildConfig/filesPfiles

property

BuildConfig.filesfiles?: Recordstring, string | ArrayBufferLike | TypedArrayArrayBufferLike> | Blob>

A map of file paths to their contents for in-memory bundling.

This allows you to bundle virtual files that don't exist on disk, or override the contents of files that do exist on disk. The keys are file paths (which should match how they're imported) and the values are the file contents.

File contents can be provided as:

string - The source code as a stringBlob - A Blob containing the source codeNodeJS.TypedArray - A typed array (e.g., Uint8Array) containing the source codeArrayBufferLike - An ArrayBuffer containing the source code
// Bundle entirely from memory (no files on disk needed)
await Bun.build({
entrypoints: ["/app/index.ts"],
files: {
"/app/index.ts": `
import { helper } from "./helper.ts";
console.log(helper());
`,
"/app/helper.ts": `
export function helper() {
return "Hello from memory!";
}
`,
},
});

Resources

ReferenceDocsGuidesDiscordMerch StoreGitHubBlog 

Toolkit

RuntimePackage managerTest runnerBundlerPackage runner

Project

Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicense

Baked with ❤️ in San Francisco

We're hiring →

property files | Bun module | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    A map of file paths to their contents for in-memory bundling. This allows you to bundle virtual files that don