Part of the problem with just concatenating a file is not the time it took to download, it is the time it took to compile on each page.
If you have 20,000 lines of the file, and you need only 600 of these lines to make it work (provided that everything is written as modular and asynchronous, using any template for resource management) then you are going to save, which can be for half a second or more if you serve the main program and expand as necessary (or on a delayed timer, serving large pieces of functionality that are closely related to each other).
The total time spent downloading is higher.
The total number of HTTP connections used is higher.
But the time required for the page to be visible to the user is lower.
The time required to add basic functions to the page is below.
Then, additional functionality can be broadcast, either after loading and initialization, or just on time, as requested by the user, and in both cases, while the code you passed is oriented towards this and does not require half a dozen other dependencies, the time between the request and adding functionality will be minimal.
RequireJS uses the promise system mainly.
It allows you to declare dependencies in front and pass the code (as a callback), which will be implemented after processing all its dependencies.
If these dependencies have any dependencies, then they will not be initialized until their dependencies are loaded.
If you just want it loaded, and the order is not important, you do not need to specify its dependencies.
General moral: if you have a system where all your files are small, the total weight of JS on the page is very small, you need only a few hundred lines to do everything you need on the page ...... plus, you know, where are all your dependencies, you have a system on the server to make sure they are in the correct order, etc. (plus you have excellent documentation, or you are the only one who deals with this code, and you live inside it, every day) ... ... then there is nothing wrong with doing what you do.
You may not see any difference if the compilation time is outweighed by the number of HTTP requests you make. But for general applications that are tens (or hundreds) of thousands of lines, where only part of this functionality is required on one page, there can be significant savings in terms of the estimated time between page loading and the application is โreadyโ for basic user interaction.