Skip to content
Neodymium edited this page Jul 23, 2022 · 6 revisions

1. What?! Another Discord plugin bundler/builder/transpiler? Aren't there a few of those already?

Well, there's a few reasons I decided to make a new one...

First, none of the others really worked perfectly and exactly the way I wanted them to, and most were lacking guides or documentation. This is definitely something I could deal with though, which leads me to my second, and main reason for making this bundler.

I was just kind of bored and wanted something useful to make ¯\_(ツ)_/¯. I was working on some kind of Webpack configuration for my own plugin development, so I decided to put the work into making it a hopefully easy to use public package. Even if BundleBD isn't the most feature-rich or well optimized Discord plugin bundler on the market, the experience from making a real package (for the first time for me) and utilizing some of the skills I've learned in the past was definitely worth all the effort. And maybe over time it will be able to grow into something better.

2. Why are typings/autocomplete not working?

Due to how VS Code and Typescript look for type declarations by default, BundleBD's types may not be automatically detected and used for autocomplete. There are a few solutions to this though.

Solution 1: Including a reference directive

This one is pretty self explanatory. Adding a reference directive to the top of your file will allow Typescript to detect the bundler's types, like so:

/// <reference types="bundlebd" />

export default class Plugin {
    start() {
        console.log("No more type issues!");
    }

    stop() {}
}

Solution 2: Importing one of the built-in modules

Just like including a reference directive, you can import one of the bundler's built-in modules, and Typescript will detect the bundler's types. Don't do this if you're not actually using the imported module.

import Styles from "bundlebd/styles";
import "./index.css";

export default class Plugin {
    start() {
        Styles.inject();
        console.log("No more type issues!");
    }

    stop() {
        Styles.clear();
    }
}

Solution 3: TSConfig (Recommended)

Using a TSConfig file requires a little extra work, but should automatically detect the bundler's types in every file. Simply make a tsconfig.json file in your root folder with the following contents:

// tsconfig.json

{
    "compilerOptions": {
        "types": ["node", "bundlebd"]
    }
}

Or, if you're already using a TSConfig file, you can add the types property to it.

For more information on recommended Typescript configuration, see here.

3. I have a feature/change suggestion or bug to report, what should I do?

Just make an issue on Github, and I'll be sure to take a look at it and be happy to solve any problems or consider any requests. Make sure your issue thoroughly and clearly describes the bug or feature, and include any other info like examples, images, etc. that might be helpful.

4. Why are there not any built-in Discord Module references?

I didn't really think it was all that necessary. When you're making a smaller plugin, chances are you just want to find and use the modules you need yourself. When you're making a larger, more complex plugin, you'd probably be using ZLibrary and its built-in DiscordModules. If there becomes a need for it or if I get a lot of requests for it (like that many people will really be using this bundler lmao), I'll definitely put in the effort to add some.