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.

npm install bundlebd
INSTALL
IMPORT
SIG · BUNDLEBD
B
bundlebd
devopsjavascriptv5.1.4
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.

bundlebd
import bundlebd from 'bundlebd'
const bundlebd = require('bundlebd')
ESM-only package; default import is the bundler function.
BundleBD
import BundleBD from 'bundlebd'
import { BundleBD } from 'bundlebd'
The default export is also named BundleBD; named export does not exist.
types
import type { Options } from 'bundlebd'
TypeScript types are bundled; use type import for Options, Config, etc.

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 issues
breakingIn v5.0.0, the API changed from a callback-based to a promise-based interface.
fix
Use async/await or .then() instead of passing callbacks to bundlebd().
affects: >=5.0.0
gotchaOutput file extension must be .plugin.js or .plugin.json for BetterDiscord to detect the plugin.
fix
Ensure output path ends with '.plugin.js' (or '.plugin.json' for library format).
affects: >=0.0.0
gotchaTypeScript declarations are generated only if the entry point uses .ts/.tsx extension and tsconfig.json is present.
fix
Set 'declaration: true' in tsconfig.json and use a .ts entry file.
affects: >=0.0.0
deprecatedIn v5.2.0, the 'css' option will be deprecated in favor of 'styles'.
fix
Use 'styles: true' instead of 'css: true' in options.
affects: >=5.2.0
gotchaJSX requires a pragma declaration (e.g., /** @jsx BdApi.React.createElement */) at the top of the entry file.
fix
Add the JSX pragma comment to your entry file or configure 'jsxFactory' in options.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'bundlebd'
Missing installation or incorrect import path.
fix
Run 'npm i bundlebd -D' and use 'import bundlebd from "bundlebd"'.
TypeError: bundlebd is not a function
Using named import instead of default import.
fix
Use 'import bundlebd from "bundlebd"' (not 'import { bundlebd } from "bundlebd"').
Error: Output file must have .plugin.js or .plugin.json extension
Output path does not match required naming convention.
fix
Set output to end with '.plugin.js' (e.g., 'dist/myPlugin.plugin.js').
Upgrade
Version history
5.1.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
bundlebd — npm install bundlebd · libregistry