Registry / devops / esbuild-bitburner-plugin

esbuild-bitburner-plugin

JSON →
library1.7.9jsnpmunverified

An ESBuild plugin (v1.7.9) that uses Bitburner's Remote API to push compiled build results directly into the game. It supports automatic file uploading, file mirroring for bidirectional sync, and distribution of scripts to multiple servers. Key differentiators: seamless integration with the Bitburner editor, support for React with ingame React/ReactDOM instances, and optional Netscript definitions generation. This plugin is actively maintained and requires Node >=20.0.0.

npm install esbuild-bitburner-plugin
INSTALL
IMPORT
SIG · ESBUILD-BITBURNER-
E
esbuild-bitburner-plugin
devopsjavascriptv1.7.9
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

BitburnerPlugin
import { BitburnerPlugin } from 'esbuild-bitburner-plugin'
const BitburnerPlugin = require('esbuild-bitburner-plugin')
ESM-only; CommonJS require() will fail with the default export.
BitburnerPlugin
const { BitburnerPlugin } = await import('esbuild-bitburner-plugin')
const BitburnerPlugin = require('esbuild-bitburner-plugin')
For dynamic imports, use ESM dynamic import.
BitburnerPlugin
import BitburnerPlugin from 'esbuild-bitburner-plugin'
import * as BitburnerPlugin from 'esbuild-bitburner-plugin'
The default export is the plugin function; the named export is also available.

Sets up an ESBuild context with the Bitburner plugin to watch and auto-upload scripts to the game.

import { context } from 'esbuild'; import { BitburnerPlugin } from 'esbuild-bitburner-plugin'; const createContext = async () => { return await context({ entryPoints: ['servers/**/*.js', 'servers/**/*.ts'], outbase: './servers', outdir: './build', plugins: [BitburnerPlugin({ port: 12525, types: 'NetscriptDefinitions.d.ts', })], bundle: true, format: 'esm', platform: 'browser', logLevel: 'info', }); }; const ctx = await createContext(); ctx.watch();
Debug
Known issues
gotchaPlugin only works with esbuild's context() API; using build() directly will not trigger uploads.
fix
Use context() with .watch() or .rebuild() instead of build().
affects: >=1.0.0
breakingNode.js >=20.0.0 is required; older versions will cause runtime errors.
fix
Upgrade Node.js to version 20.0.0 or later.
affects: >=1.0.0
gotchaFile structure in outdir determines target server; e.g., build/home/foo.js uploads to home server.
fix
Ensure outdir contains subdirectories named after in-game servers.
affects: >=1.0.0
deprecatedThe 'types' option may be renamed in future versions; check migration guides.
fix
Monitor GitHub releases for deprecations.
affects: 1.7.x
Errors
Common errors & fixes
Error: Cannot find module 'esbuild-bitburner-plugin'
Package not installed or wrong import path.
fix
Run 'npm install esbuild-bitburner-plugin' and ensure correct import syntax.
TypeError: BitburnerPlugin is not a function
Using default import correctly but module returns an object.
fix
Use named import: import { BitburnerPlugin } from 'esbuild-bitburner-plugin'.
Error: listen EADDRINUSE :::12525
Port 12525 already in use by another instance.
fix
Kill the other process or specify a different port in the plugin options.
Build failed with 1 error: error: Could not resolve 'React'
React imports are expected to be resolved by the in-game React, but bundler tries to resolve locally.
fix
Mark React as external: external: ['React'] in esbuild config.
Upgrade
Version history
1.7.9latest on npm
Audit
Dependencies
esbuildrequiredPeer dependency; the plugin hooks into esbuild's build process.
Agent activity
9 hits · last 30 days
node
6
OpenAI (training)
2
Bingbot
1
Resources
esbuild-bitburner-plugin — npm install esbuild-bitburner-plugin · libregistry