<script wake-loader src="/loader.min.js"></script>
string main-file (main.js) string main , string update , bool quick true, main DOMContentLoaded, false - onload bool cached object alias array queue
<script> wakeloader = { mainFile : "/app/main", main : "main", update : "04.04.2013", quick : true, cached : true, alias : { "http://code.jquery.com/" : "jquery/" }, queue : ["/app/widget","jquery/jquery-2.0.2.min",{ "http://some.serv.er/lib/" : ["sugar","backbone"] }] }; </script> <script wake-loader src="/loader.min.js"></script>
<script wake-loader data-main-file="/app/main" data-main data-update="04.04.2013" data-cached data-quick data-alias='{ "http://code.jquery.com/" : "jquery/" }' src="/loader.min.js"> ["/app/widget","jquery/jquery-2.0.2.min",{ "http://some.serv.er/lib/" : ["sugar","backbone"] }] </script>
data-queue
attribute.require
and updateQueue
.require
downloads the scripts you specify, available in the global namespace. require('jquery/jquery-1.10.1.min','/app/lastfm-api');
updateQueue
function, the first time the page is refreshed, the queue cache will be updated. The function is available only from the wakeloader
object.require
function in only one way - loading scripts via XMLHttpRequest and putting the code inside the tags . , .
: , , .

, cached
true
, .

require
localStorage
, .

requirejs, .

( ). , wakeloader c - 700ms, requirejs - 800ms.
UPD: requirejs, shim:

.
GitHub. .
PS: php-cli , wakeloader'a github'e.
Source: https://habr.com/ru/post/182292/
All Articles