Commando icon indicating copy to clipboard operation
Commando copied to clipboard

Registering ES6 modules as commands

Open PermissionError opened this issue 4 years ago • 3 comments

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.

PermissionError avatar Feb 02 '21 08:02 PermissionError

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

Zelzahn avatar Mar 12 '21 23:03 Zelzahn

What’s keeping this package from supporting ESM altogether?

xlvnacyx avatar Jun 11 '21 22:06 xlvnacyx

Having ES modules support would be great

uwuLegacy avatar Jun 15 '21 22:06 uwuLegacy