Open ljani opened 5 years ago
Hi, same for me. Just looking into code, it seems like minifying is not supported for standard input? Using -i-
per above triggers 'simple mode':
Which skips adding surrounding function()
, resulting in invalid JavaScript like what you see in output above (instead it returns a regular object which I guess uglify is not expecting to see).
E.g. running node ./handlebars cheese.txt
(cheese.txt contains same text, test
) results in non-simple mode and parseable JavaScript:
(function() {
var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
templates['cheese.txt'] = template({"compiler":[8,">= 4.3.0"],"main":function(container,depth0,helpers,partials,data) {
return "test\n";
},"useData":true});
})();
But is that a bug or a feature (request)?
If I try to minify output provided from
stdin
,uglify-js
seems to fail to minimize it and there are no errors or warnings. Here's a test case:Without
-m
it works:uglify-js
seems to return this error if I logoutput
inprecompiler.js
:I'm on Windows 10 build 17763.437 with PowerShell Core 6.2.0,
handlebars@4.1.2
, and NodeJSv11.14.0
.Also, is
stdin
only handled by-i
or should--string
also support passing-
, since the latter does not seem to work?Thanks for your work!