PreplMode
Bun

property

TranspilerOptions.replMode

replMode?: boolean

Enable REPL mode transforms:

  • Wraps top-level inputs that appear to be object literals (inputs starting with '{' without trailing ';') in parentheses
  • Hoists all declarations as var for REPL persistence across vm.runInContext calls
  • Wraps last expression in { proto: null, value: expr } for result capture
  • Wraps code in sync/async IIFE to avoid parentheses around object literals