You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a frontend developer, I want to have close control over the Modulo build system. There is no documentation currently, which means I can only learn how to do so by reading the Modulo.js code.
The default that needs documentation:
<Artifactname="css" bundle="link[rel=stylesheet]" exclude="[modulo-asset]"><Template>{% for elem in bundle %}{{ elem.bundledContent|safe }}{% endfor %}
{% for css in assets.cssAssetsArray %}{{ css|safe }}
{% endfor %}</Template></Artifact><Artifactname="js" bundle="script[src]" exclude="[modulo-asset]"><Templatemacros="yesplease">window.moduloBuild = window.moduloBuild || { modules: {}, nameToHash: {} };
{% for name, hash in assets.nameToHash %}{% if hash in assets.moduleSources %}{% if name|first is not "_" %}
window.moduloBuild.modules["{{ hash }}"] = function {{ name }} (modulo) {
{{ assets.moduleSources|get:hash|safe }}
};
window.moduloBuild.nameToHash.{{ name }} = "{{ hash }}";
{% endif %}{% endif %}{% endfor %}
window.moduloBuild.definitions = { {% for name, value in definitions %}
{% if name|first is not "_" %}{{ name }}: {{ value|json|safe }},{% endif %}
{% endfor %} };
{% for elem in bundle %}{{ elem.bundledContent|safe }}{% endfor %}
modulo.start(window.moduloBuild);
{% for name in assets.mainRequires %}
modulo.assets.require("{{ name|escapejs }}");
{% endfor %}
</Template></Artifact><Artifactname="html" remove="script[src],link[href],[modulo-asset],template[modulo],script[modulo],modulo"><Script>
for (const elem of window.document.querySelectorAll('*')) {
if (elem.isModulo && elem.originalHTML !== elem.innerHTML) {
elem.setAttribute('modulo-original-html', elem.originalHTML);
}
}
script.exports.prefix = '<!DOCTYPE html><html><head>' + (window.document.head ? window.document.head.innerHTML : '');
script.exports.interfix = '</head><body>' + (window.document.body ? window.document.body.innerHTML : '');
script.exports.suffix = '</body></html>';
</S` + `cript>
<Template>{{ script.prefix|safe }}<link rel="stylesheet" href="{{ definitions._artifact_css.OutputPath }}" />
{{ script.interfix|safe }}<script src="{{ definitions._artifact_js.OutputPath }}"></s` + `cript>
{{ script.suffix|safe }}</Template>
</Artifact>
The text was updated successfully, but these errors were encountered:
michaelpb
changed the title
Document Artifact system and build system
Document how to define custom build Artifacts, and how to hook into build system
Apr 5, 2023
As a frontend developer, I want to have close control over the Modulo build system. There is no documentation currently, which means I can only learn how to do so by reading the Modulo.js code.
The default that needs documentation:
The text was updated successfully, but these errors were encountered: