1 | require([
|
2 | <%= names %>
|
3 | ], function (<%= objects %>) {
|
4 | var adoptables = [<%= adoptables %>];
|
5 | var isVendor = new RegExp('vendor(.*js)');
|
6 |
|
7 | function recursiveRequire(i, scripts){
|
8 | if (i >= scripts.length) {
|
9 | return;
|
10 | }
|
11 | require([scripts[i]], function() {
|
12 | if (isVendor.test(scripts[i])) {
|
13 | adoptables.forEach(function(adoptable) {
|
14 | enifed(adoptable.name, [], function() {
|
15 | if (typeof adoptable.obj === 'function' || typeof adoptable.obj === 'object') {
|
16 | return new Proxy(adoptable.obj, {
|
17 | get(obj, prop) {
|
18 | return prop === 'default' && !(prop in obj) ? obj : obj[prop];
|
19 | }
|
20 | });
|
21 | }
|
22 |
|
23 | return adoptable.obj;
|
24 | });
|
25 | });
|
26 | }
|
27 | recursiveRequire(++i, scripts);
|
28 | });
|
29 | }
|
30 | recursiveRequire(0, [<%= scripts %>]);
|
31 | });
|