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

Unified Diff: templates/modules.js.tmpl

Issue 29363565: Issue 4552 - Drop jshydra dependency (buildtools) (Closed)
Patch Set: Created Nov. 18, 2016, 5:20 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« packagerChrome.py ('K') | « packagerChrome.py ('k') | tox.ini » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: templates/modules.js.tmpl
diff --git a/templates/modules.js.tmpl b/templates/modules.js.tmpl
new file mode 100644
index 0000000000000000000000000000000000000000..479b5b1302e4ffbcaf7c2a974effda25a0a3087e
--- /dev/null
+++ b/templates/modules.js.tmpl
@@ -0,0 +1,19 @@
+{%- if args["module"] -%}
kzar 2016/11/18 17:25:48 I went without indentation since it made the rende
+{%- for module_name, script in modules -%}
+require.modules[{{ module_name|json|safe }}] = function(module, exports, require)
Wladimir Palant 2016/11/30 11:39:32 No point passing in require as parameter, the glob
kzar 2016/11/30 14:29:45 Done.
+{
+{{ script|safe }}
Wladimir Palant 2016/11/30 11:39:32 Enabling autoescaping and then marking each variab
kzar 2016/11/30 14:29:44 Lol good point, done.
+return exports;
Wladimir Palant 2016/11/30 11:42:14 This should return module.exports, in case the mod
kzar 2016/11/30 14:29:44 Done.
+};
+
+{% endfor -%}
+{% for module_name, script in modules -%}
Wladimir Palant 2016/11/30 11:39:32 This should be {%- for ... -%}, no point adding an
kzar 2016/11/30 14:29:45 Done.
+{%- if module_name in args["autoload"] -%}
Wladimir Palant 2016/11/30 11:39:32 This should not iterate over modules again, rather
kzar 2016/11/30 14:29:44 Done.
+require({{ module_name|json|safe }});
+{% endif -%}
+{%- endfor %}
+{%- else -%}
+{%- for module_name, script in modules -%}
+{{ script|safe }}
+{%- endfor -%}
+{% endif %}
Wladimir Palant 2016/11/30 11:39:32 This should be: {% endfor -%} {%- endif -%} In o
kzar 2016/11/30 14:29:44 Done.
« packagerChrome.py ('K') | « packagerChrome.py ('k') | tox.ini » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld