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.

composer.js 452B

12345678910111213141516171819
  1. 'use strict';
  2. var through = require('through2');
  3. var minify = require('./lib/minify');
  4. module.exports = function(uglify, logger) {
  5. return function(opts) {
  6. var minifier = minify(uglify, logger)(opts);
  7. return through.obj(function(file, encoding, callback) {
  8. var newFile = null;
  9. var err = null;
  10. try {
  11. newFile = minifier(file);
  12. } catch (e) {
  13. err = e;
  14. }
  15. callback(err, newFile);
  16. });
  17. };
  18. };