-
Notifications
You must be signed in to change notification settings - Fork 1
Command Options
The bundlebd
command takes a few possible arguments, but none are required. All options besides input
must be prefixed in the format --option value
and can be in any order. For options that are booleans, instead use the format --option
without a value.
The first argument is a path to the plugin's folder. Unlike all other command options, it must be the first argument, and does not require any prefix.
Defaults to src
.
npx bundlebd MyAmazingPlugin/src
The output
option is a path to the folder that the bundled plugin will be placed into.
Defaults to dist
.
npx bundlebd --output MyAmazingPlugin/dist
When passed the dev
option, the bundler will watch for changes and bundle the plugin when they occur. It will also attempt to copy the bundled plugin to BetterDiscord's plugins folder using the bd-path
option.
Defaults to false
.
npx bundlebd --dev
The bd-path
option is an absolute path to BetterDiscord's main folder. This is used to copy the bundled plugin to the plugins folder with the dev
option. If you want to disable copying the bundled plugin, set this value to none
.
By default, will attempt to find the BetterDiscord folder using the current platform.
npx bundlebd --dev --bd-path C:/Users/Neodymium/AppData/Roaming/BetterDiscord
Or if you want to disable copying the bundled plugin:
npx bundlebd --dev --bd-path none
The plugin
option is passed to the Bundler Configuration if it exports a function. It's purpose is to dynamically configure the bundler based on which plugin is being bundled. It is usually the plugin's name, but can be any value. See Bundler Configuration for more information.
By default, no value will be passed.
npx bundlebd --plugin MyAmazingPlugin
You can also do npx bundlebd --version
to get the current version of the bundler.
For an easy shortcut to the command, you can create scripts in your package.json file to run instead. For example you can add:
// package.json
{
// ... Rest of your package.json file ...
"scripts": {
"build": "bundlebd MyAmazingPlugin/src --output MyAmazingPlugin/dist",
"dev": "bundlebd MyAmazingPlugin/src --output MyAmazingPlugin/dist --dev"
}
}
And now you can use npm run build
and npm run dev
instead.