Registry / devops / bundlebd

bundlebd

JSON →
library5.1.4jsnpmunverified

A simple bundler for BetterDiscord plugins that supports TypeScript, JSX, CSS, CSS preprocessors, and more. Current stable version 5.1.4. Bundles plugins composed of multiple files/modules into a single plugin file, emitting readable code for reviews and debugging. Differentiators: focused specifically on BetterDiscord ecosystem, minimal configuration, and emphasis on output readability.

devops
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.

ESM-only package; default import is the bundler function.

import bundlebd from 'bundlebd'

The default export is also named BundleBD; named export does not exist.

import BundleBD from 'bundlebd'

TypeScript types are bundled; use type import for Options, Config, etc.

import type { Options } from 'bundlebd'

Shows basic usage: import the default bundler, configure entry/output, and run.

import bundlebd from 'bundlebd'; import path from 'path'; const options = { entry: path.resolve('src/index.ts'), output: path.resolve('dist/plugin.plugin.js'), minify: false, externals: { 'discord': 'Discord', 'betterdiscord': 'BetterDiscord' } }; bundlebd(options).then(() => { console.log('Bundle created successfully!'); }).catch(err => { console.error('Bundling failed:', err); });
Debug
Known footguns
breakingIn v5.0.0, the API changed from a callback-based to a promise-based interface.
gotchaOutput file extension must be .plugin.js or .plugin.json for BetterDiscord to detect the plugin.
gotchaTypeScript declarations are generated only if the entry point uses .ts/.tsx extension and tsconfig.json is present.
deprecatedIn v5.2.0, the 'css' option will be deprecated in favor of 'styles'.
gotchaJSX requires a pragma declaration (e.g., /** @jsx BdApi.React.createElement */) at the top of the entry file.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
0 hits · last 30 days

No traffic data recorded yet.

Resources