Index: templates/modules.js.tmpl |
diff --git a/templates/modules.js.tmpl b/templates/modules.js.tmpl |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c826d892704589d344ecb9fadb61348ab8448b3b |
--- /dev/null |
+++ b/templates/modules.js.tmpl |
@@ -0,0 +1,20 @@ |
+{%- if args["module"] -%} |
+{%- for module_name, script in modules -%} |
+require.modules[{{ module_name|json }}] = function(module, exports) |
+{ |
+{{ script }} |
+return module.exports; |
+}; |
+ |
+{% endfor -%} |
+{%- set modules = dict(modules) -%} |
+{%- for module_name in args["autoload"] -%} |
+{%- if module_name in modules -%} |
+require({{ module_name|json }}); |
+{% endif %} |
+{%- endfor -%} |
+{%- else -%} |
+{%- for module_name, script in modules -%} |
+{{ script }} |
+{% endfor -%} |
+{%- endif -%} |