Project

General

Profile

Feature #97652 » f_asset-js-single-inline-poc.html

Refer to multiple js files and have their content rendered inline in the <head> combined to a single script block. - Jan Loderhose, 2022-05-20 09:20

 
<!--
Refer to multiple js files and have their content rendered inline in the <head> combined to a single script block.
-->

<!--
/* example.js BEGIN */
console.log('ding');
/* example.js END */
-->

<!--
/* example2.js BEGIN */
consol.log('dong');
/* example2.js END */
-->

<!--
/* ViewHelpers BEGIN */
<f:asset.js identifier="example" href="/path-to/example.js" inline="true" />
<f:asset.js identifier="example2" href="/path-to/example2.js" inline="true" />
/* ViewHelpers END */
-->

<!-- RESULT -->
<!DOCTYPE html>
<html>
<head></head>
<body>
...
<script>
console.log('ding');
</script>
<script>
console.log('dong');
</script>
</body>
</html>
(5-5/6)