Compress inline js

How to write plugin/modifier to compress inline java script in volt. For example i have this in index.volt. I want to soft compress js, remove comments, uflify etc, so only to output:

<h1> Test header </h1>
<script type="text/javascript">
/* comments */
function abc(){
    alert('ok'); //comment
}
</script>

Volt is not made for that. Use Asset manager for that purpose.

Phalcon\Assets\Manager is available in the services container:

https://docs.phalconphp.com/en/latest/assets