Good day!
Working on an old and quite large project, around 500 scripts, all loaded via require.js individually, respectively, the loading time of the website is extremely decent.
When the load is connected in practically all scripts, so I want to have a single js file with no duplicates and other garbage.
Clear the start module is there, the script require, it is the first config and script main.js connect to the html page:
script.setAttribute("data-main", "/require-config.js?c=" + Date.now().toString());
script.onreadystatechange = script.onload = function (){
...
script.setAttribute("src", "main.js");
...
}
script.setAttribute("src", "/lib/requirejs/require.js");
How to optimize require.js app, collect all the scripts (which are loaded during boot of the site) in one file and not lose the async loading of the other files?