2

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");.

1
  • 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...) Commented Sep 1, 2020 at 12:17

1 Answer 1

2

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).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.