Answer the question
In order to leave comments, you need to log in
CommonJS / RequireJS - why?
Hello. Who can explain to a dumb person what is the difference between common.js and require.js and why are they needed at all? Plus, in what situations should such tools be needed and why do we need all these dependency injection? There is a lot of different information on the Internet, I can not come to a consensus. I'm frustrated... Thank you
Answer the question
In order to leave comments, you need to log in
Plus, in what situations should such tools be needed and why do we need all these dependency injection?
I don’t undertake to give an answer, since this is also not entirely clear to me, but after getting acquainted with nodejs, where require is used to load modules, I begin to suspect that it was adopted into the client part for the sake of a uniform approach. And in fact require on the client is not so necessary.
These tools are needed for several things:
1. Creating a modular structure
2. Lazy loading
3. Organizing and increasing control over project dependencies
All this is not needed on small projects. But without this it is difficult to manage on large ones.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question