Minify require_js Javascript


How would I go about getting code within a {% require_js %} block minified?

That is, something like:

{% require_js %}
    alert('Hello world!');
    // do something else
{% end_require_js %}


Hi @brookjordan,

Scripts included in a require_js block will be included server-side, and all assets should be served minimized by default.


It doesn't appear to be.

See ~ line 2080 of the source-code here:

Currently the 5th inline script tag.

I generally minify all of my code but haven't done so with that one yet. Something like this should be getting minified?

If it helps, here's the code file:


Hi @brookjordan,

Thank you for the examples, that was helpful. I touched base with product, and it turns our we don't minify inline JS. In order for JS to be minified automatically, it has to be hosted in the design manager as a JS file and included that way.