Using handlebars as a command line tool I can do this:
handlebars mytemplate.hbs -m
And the output is a precompiled template, where -m indicates that it should be minimized.
Using handlebars as a library from a node.js file I can do this:
var precompiled = Handlebars.precompile(mytemplate)
Question is, which is the equivalent to -m when calling Handlebars.precompile method?
You cannot do that because of Handlebars cli such an interface to Handlebars lib itself and it uses UglifyJS for minification.
But you can do that manually by requiring uglify and call uglify.minify like Handlebars cli do:
var uglify = require('uglify');
var precompiled = Handlebars.precompile(mytemplate);
precompiled = uglify.minify(precompiled);