Simple image host.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

minify.js 525B

1234567891011121314151617181920212223
  1. var minifyHtml = require("html-minifier").minify;
  2. var minifyJs = require("uglify-js");
  3. var minifyCss = require("uglifycss").processString;
  4. exports.html = function(src) {
  5. return minifyHtml(src, {
  6. removeComments: true,
  7. collapseWhitespace: true,
  8. minifyJS: true
  9. });
  10. }
  11. exports.js = function(src) {
  12. var ast = minifyJs.parse(src);
  13. ast.figure_out_scope();
  14. var compressor = minifyJs.Compressor();
  15. ast = ast.transform(compressor);
  16. return ast.print_to_string();
  17. }
  18. exports.css = function(src) {
  19. return minifyCss(src);
  20. }