Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: templates/modules.js.tmpl

Issue 29363565: Issue 4552 - Drop jshydra dependency (buildtools) (Closed)
Left Patch Set: Addressed feedback, make tox pass Created Nov. 30, 2016, 2:23 p.m.
Right Patch Set: Check module exists before auto-loading it Created Nov. 30, 2016, 3:24 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « releaseAutomation.py ('k') | tox.ini » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 {%- if args["module"] -%} 1 {%- if args["module"] -%}
2 {%- for module_name, script in modules -%} 2 {%- for module_name, script in modules -%}
3 require.modules[{{ module_name|json }}] = function(module, exports) 3 require.modules[{{ module_name|json }}] = function(module, exports)
4 { 4 {
5 {{ script }} 5 {{ script }}
6 return module.exports; 6 return module.exports;
7 }; 7 };
8 8
9 {% endfor -%} 9 {% endfor -%}
10 {%- set modules = dict(modules) -%}
10 {%- for module_name in args["autoload"] -%} 11 {%- for module_name in args["autoload"] -%}
12 {%- if module_name in modules -%}
11 require({{ module_name|json }}); 13 require({{ module_name|json }});
Wladimir Palant 2016/11/30 14:54:44 It's probably a good idea to check first whether t
kzar 2016/11/30 15:26:18 Done.
12 {% endfor %} 14 {% endif %}
15 {%- endfor -%}
13 {%- else -%} 16 {%- else -%}
14 {%- for module_name, script in modules -%} 17 {%- for module_name, script in modules -%}
15 {{ script }} 18 {{ script }}
16 {% endfor -%} 19 {% endfor -%}
kzar 2016/11/30 14:29:45 `{%` not `{%-` so that the require calls are separ
17 {%- endif -%} 20 {%- endif -%}
LEFTRIGHT

Powered by Google App Engine
This is Rietveld