D
D
DarthJS2019-05-27 11:58:32
JavaScript
DarthJS, 2019-05-27 11:58:32

How does webpack bundle libraries into node_modules?

There are libraries in node_modules and as far as I understand webpack bandits imported libraries into vendors if we specify and minify. But in libraries I often see dist and src , respectively, you can use already minified dist , but then why bundle libraries through webpack ?
Questions:
- Do I need to bundle libraries from node_modules ?
- How to use dist libraries from node_modules ?
- Why dist in libraries, if suddenly it is not used with the webpack bundle ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shvets, 2019-05-27
@DarthJS

- Do I need to bundle libraries from node_modules?

usually they are all placed in vendor.js. Whether you need it or not, you decide.
In manuals to libraries it should be written. Usually just importing the package is done. And there, as the developer of the library commanded.
What if the user of the library is not using webpack?
Plus, they often make amd, esm options. For different import schemes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question