npm install compact
Then in the view use the compactJsHtml() view helper
On / you'd get the following
On /blog you'd get this
You also have access to the compactJs() helper which will return an array of files for you to include on the page.
Licenced under the New BSD License