Answer the question
In order to leave comments, you need to log in
How to optimize a project on require.js?
Good afternoon!
I am working on an old and fairly large project, about 500 scripts, everything is loaded via require.js separately, so the site loading time is extremely inappropriate.
When loading, almost all scripts are connected, so I want to have one js file, without duplicates and other garbage.
There is no clear start module, the require script, its config and the first main.js script are included in 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");
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question