H
H
hbrmdc2015-09-10 22:31:20
JavaScript
hbrmdc, 2015-09-10 22:31:20

What happens to installed (npm install) packages when compiling a build?

Periodically, you have to deal with other people's builds. I'm just horrified by the number of installed packages, not even counting those that are responsible for the build and do not participate in the final js file. I myself have never used more than 15 packages, of which a couple may not be fully used.
And so I thought, maybe I don’t understand something, maybe such a wild (20, 30, 40 ...) number of packages does not greatly affect the complexity of maintaining the application and the size of js files?
Let's say if I installed lodash, included it in one of the js files (require), and used one single method from this library - will it still be entirely present in the js file after compilation?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ruslan Abdullaev, 2015-09-14
@rajdee

Nothing happens to them, they remain in your working directory, and only those files that you included via require / import or specified directly in the configuration files of the builder get into the assembly, this is periodically done with bower packages.
This is assuming you don't recursively include anything from node_modules.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question