BDBuilder
raw JSON → 1.2.6-preview.4 verified Fri May 01 auth: no javascript
A specialized build tool and transpiler for BetterDiscord plugins that allows developers to write plugins using multiple files, TypeScript, or modern JavaScript, then bundles them into a single plugin file compatible with BetterDiscord. Currently at version 1.2.6-preview.4, it's in preview stage and not yet released on the official npm registry. It provides features like production builds, watch mode for development, and automatic copying to the BetterDiscord plugins folder. Compared to alternatives like Ittai, BDBuilder is a simpler, dedicated solution for BetterDiscord plugin development, focusing on ease of use and essential functionality.
Common errors
error Error: Cannot find module '@betterdiscordbuilder/bdbuilder' ↓
cause Package not installed because .npmrc or authentication is missing.
fix
Create .npmrc with 'registry', authenticate with GitHub token, then reinstall.
error ERR_REQUIRE_ESM ↓
cause Using CommonJS require() on an ESM-only package.
fix
Use import statement instead of require().
Warnings
breaking Package is not yet published on official npm registry; only available via GitHub Packages. ↓
fix Set up .npmrc file with @betterdiscordbuilder:registry=https://npm.pkg.github.com and authenticate with a GitHub token.
deprecated The 'ittai' package is considered legacy; BDBuilder is the simpler successor. ↓
fix Migrate from ittai to @betterdiscordbuilder/bdbuilder for BetterDiscord plugin development.
gotcha Watch mode may not automatically rebuild if new files are added to the plugin directory; only changes to existing files trigger rebuilds. ↓
fix Manually restart the watch process after adding new source files.
gotcha The package requires Node.js version >=14 due to ESM and async/await usage. ↓
fix Update Node.js to a version >=14.
Install
npm install bdbuilder yarn add bdbuilder pnpm add bdbuilder Imports
- bdbuilder wrong
const bdbuilder = require('@betterdiscordbuilder/bdbuilder')correctimport { bdbuilder } from '@betterdiscordbuilder/bdbuilder' - default wrong
import { bdbuilder } from '@betterdiscordbuilder/bdbuilder'correctimport bdbuilder from '@betterdiscordbuilder/bdbuilder' - PluginConfig
import { PluginConfig } from '@betterdiscordbuilder/bdbuilder'
Quickstart
// bdbuilder.config.ts
import { defineConfig } from '@betterdiscordbuilder/bdbuilder';
export default defineConfig({
plugin: './src/index.ts',
copy: 'C:/Users/Username/AppData/Roaming/BetterDiscord/plugins',
watch: true,
production: false,
});
// Or CLI usage:
// npx @betterdiscordbuilder/bdbuilder --plugin="./src/index.ts" --copy="./plugins" --watch --production