Skip to content
This repository has been archived by the owner on Dec 24, 2021. It is now read-only.

Registering ES6 modules as commands #371

Open
PermissionError opened this issue Feb 2, 2021 · 3 comments
Open

Registering ES6 modules as commands #371

PermissionError opened this issue Feb 2, 2021 · 3 comments

Comments

@PermissionError
Copy link

PermissionError commented Feb 2, 2021

When using registerCommandsIn() to register commands while using "type": "module" in package.json and coding commands as ES6 modules, Commando will not be able to register the commands. This is probably because it uses require-all which doesn't work with ES6 modules. I wrote a custom command loader to get around this, but it's not robust at all and probably isn't fit for a PR.

I'm not sure whether ESM support is in scope for Commando, but seeing as discord.js supports ESM I'm considering this issue as a bug. Feel free to correct me otherwise.

@Zelzahn
Copy link

Zelzahn commented Mar 12, 2021

I worked around this by transpiling my code whenever I save, roughly according to this guide.

@ephemeralrogue
Copy link

What’s keeping this package from supporting ESM altogether?

@uwuLegacy
Copy link

Having ES modules support would be great

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants