Skip to content

Configuration Reference

Tronbun projects are configured via tronbun.config.json in the project root.

Full Schema

json
{
  "name": "my-app",
  "version": "1.0.0",
  "main": "src/main.ts",
  "web": { ... },
  "backend": { ... },
  "build": { ... },
  "app": { ... },
  "window": { ... },
  "tray": { ... },
  "notifications": { ... }
}

Top-Level Fields

FieldTypeDefaultDescription
namestring"tronbun-app"Project name. Used for bundle ID, app name, and display.
versionstring"1.0.0"Semantic version string.
mainstring"src/main.ts"Main entry point (legacy alias for backend.entry).

web — Frontend Configuration

FieldTypeDefaultDescription
entrystring"src/web/index.ts"Frontend entry file.
outDirstring"dist/web"Frontend build output directory.
publicDirstring"public"Static assets directory. Contents are copied to outDir during build.

backend — Backend Configuration

FieldTypeDefaultDescription
entrystring"src/main.ts"Backend entry file.
outDirstring"dist"Backend build output directory.

build — Build Settings

FieldTypeDefaultDescription
targetstring"bun"Build target runtime.
minifybooleanfalseMinify output during build.
sourcemapbooleantrueGenerate source maps. Disabled automatically during compilation.
obfuscationobjectJavaScript obfuscation options (see below).

build.obfuscation — Code Protection

Obfuscation is applied to frontend code during compilation only. Powered by javascript-obfuscator.

FieldTypeDefaultDescription
enabledbooleanfalseEnable code obfuscation.
compactbooleantrueRemove line breaks and whitespace.
controlFlowFlatteningbooleanfalseFlatten control flow (increases code size).
controlFlowFlatteningThresholdnumber0.75Probability (0-1) of applying to each node.
deadCodeInjectionbooleanfalseInject unreachable code blocks.
deadCodeInjectionThresholdnumber0.4Probability (0-1) of injection.
identifierNamesGeneratorstringGenerator type: "hexadecimal", "mangled", or "mangled-shuffled".
renameGlobalsbooleanfalseRename global declarations. Warning: breaks window.* APIs.
selfDefendingbooleanfalseAnti-tampering protection. Warning: may cause issues with React.
stringArraybooleantrueMove strings to a shared array.
stringArrayEncodingstring[]["base64"]Encoding: "none", "base64", or "rc4".
stringArrayThresholdnumber0.75Probability (0-1) of moving each string.
splitStringsbooleanfalseSplit strings into chunks.
splitStringsChunkLengthnumber10Maximum chunk length.
transformObjectKeysbooleanfalseObfuscate object keys.
unicodeEscapeSequencebooleanfalseUse unicode escapes. Warning: performance impact.

app — Application Metadata

Used during compilation to configure the native app bundle.

FieldTypeDefaultDescription
identifierstring"com.tronbun.<name>"Bundle identifier (macOS) / app ID.
iconstring"assets/icon.icns"macOS app icon path (.icns).
iconWinstring"assets/icon.ico"Windows app icon path (.ico).
categorystringmacOS app category (e.g., "public.app-category.developer-tools").

window — Default Window Settings

These values are used as defaults when creating Window or WindowIPC instances.

FieldTypeDefaultDescription
titlestringWindow title bar text.
widthnumber800Window width in pixels.
heightnumber600Window height in pixels.
minWidthnumberMinimum window width.
minHeightnumberMinimum window height.
maxWidthnumberMaximum window width.
maxHeightnumberMaximum window height.
resizablebooleantrueAllow window resizing.
centerbooleanCenter window on screen at startup.
alwaysOnTopbooleanKeep window above other windows.
fullscreenbooleanStart in fullscreen mode.
framelessbooleanRemove window decorations (title bar, borders).
opacitynumber1.0Window opacity (0.0 to 1.0).

tray — System Tray Settings

FieldTypeDefaultDescription
enabledbooleanfalseEnable the system tray icon.
iconstringTray icon path (relative to project root).
tooltipstringTooltip text shown on hover.

notifications — Notification Settings

FieldTypeDefaultDescription
enabledbooleantrueEnable desktop notification support.

Default Configuration

If no tronbun.config.json exists, these defaults are used:

json
{
  "name": "tronbun-app",
  "version": "1.0.0",
  "main": "src/main.ts",
  "web": {
    "entry": "src/web/index.ts",
    "outDir": "dist/web",
    "publicDir": "public"
  },
  "backend": {
    "entry": "src/main.ts",
    "outDir": "dist"
  },
  "build": {
    "target": "bun",
    "minify": false,
    "sourcemap": true
  }
}

Example: Full Configuration

json
{
  "name": "my-app",
  "version": "1.0.0",
  "main": "src/main.ts",
  "web": {
    "entry": "src/web/index.ts",
    "outDir": "dist/web",
    "publicDir": "public"
  },
  "backend": {
    "entry": "src/main.ts",
    "outDir": "dist"
  },
  "build": {
    "target": "bun",
    "minify": true,
    "sourcemap": false,
    "obfuscation": {
      "enabled": true,
      "compact": true,
      "stringArray": true,
      "stringArrayEncoding": ["base64"]
    }
  },
  "app": {
    "identifier": "com.example.myapp",
    "icon": "assets/icon.icns",
    "iconWin": "assets/icon.ico",
    "category": "public.app-category.productivity"
  },
  "window": {
    "title": "My Application",
    "width": 1024,
    "height": 768,
    "minWidth": 400,
    "minHeight": 300,
    "resizable": true,
    "center": true
  },
  "tray": {
    "enabled": true,
    "icon": "assets/tray-icon.png",
    "tooltip": "My App"
  },
  "notifications": {
    "enabled": true
  }
}

Released under the GPLv3 License.