Answer the question
In order to leave comments, you need to log in
Do I understand the essence of webpack, task runners, requirejs and modules correctly?
Good evening.
I read about webpack - I've never used it before. Along the way, I read about topics related to it (modules, RequireJS) and made some conclusions.
1) Webpack is just a build system, not a task runner, and it's not fair to compare the two. Roughly speaking, webpack is similar to a ready-made task runner plugin package, plus a few unique features that are unique to it. At the same time, it itself is an npm package, albeit with a cli, and can be controlled through the task runner if necessary ( but the task runner cannot be controlled through the build system, because it simply does not have the authority to do so, and this is pointless ). This is the key difference: the build system is Vasya (albeit a very skilled one), and the task runner is a top manager. So?
2) Since the module is essentially just a pattern that needs to be followed, as a result, after assembly, we still get one or two large files (in accordance with the rules in the config). In other words, I will achieve a similar result in a barbaric way, gluing files together without any modules through gulp (encapsulating the content using objects). Right? I understand that modularity makes projects easier to maintain, scale, and maintain, but the bottom line is what counts.
3) To use a modular approach on the client, for example, using RequireJS, you need to connect it, let it work out and put the necessary files into the page code on the fly. Perhaps that is why famous projects that use all these newfangled features lag so violently in comparison with ordinary sites where a simple minified js is connected to three hundred kilobytes? And thus, we automatically roll back to point 2 to the assembly of modules.
How much do you agree with the above? What are the arguments against if these conclusions are wrong?
Thanks in advance.
Answer the question
In order to leave comments, you need to log in
In other words, I will achieve a similar result in a barbaric way, gluing files together without any modules through gulp (encapsulating the content using objects). Right?
About Yes. The only thing I disagree with is the third point:
What famous projects are lagging? twitter? gmail? google and yandex maps Google docs? After all, no, although there is a rich and complex functionality. Dirty and facebook lag, because they are hung with crooked advertising to the very worst. Here are all sorts of banner networks with crooked pictures, videos and JS written in 1997 and slow down.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question