After using npm to install module
npm install discord.js
a folder with name discord.js was created but I want to compile this node module to a single javascript file and use it in my project require("./discord.js");.
-
What about using a module bundler? You can require the files you need in a single file and bundle their content into a single file using a module bundler (webpack, rollup, parcel...)raphalogou– raphalogou2020-09-01 12:17:26 +00:00Commented Sep 1, 2020 at 12:17
Add a comment
|
1 Answer
The simplest solution would be to use the webpack builds of discord.js, available here. Note that there are some restrictions when using these files. (you can also compile the files yourself using another tool so everything will work).