Pcompile
Bun

property

CompileBuildConfig.compile

compile: boolean | CompileBuildOptions | Target

Create a standalone executable

When true, creates an executable for the current platform. When a target string, creates an executable for that platform.

// Create executable for current platform
await Bun.build({
  entrypoints: ['./app.js'],
  compile: {
    target: 'linux-x64',
  },
  outfile: './my-app'
});

// Cross-compile for Linux x64
await Bun.build({
  entrypoints: ['./app.js'],
  compile: 'linux-x64',
  outfile: './my-app'
});