Minify css/js output with uglify-js and clean-css

npm install component-minify
4 downloads in the last day
95 downloads in the last week
154 downloads in the last month

Component Minify

Plugin for component-buider, to minify js/css output with uglify-js and clean-css.


It useful to prepare assets for production from command line,

$ component build --use component-minify

Or manually with builder.js:

var Builder = require('component-builder');
var minify  = require('component-minify');
var fs      = require('fs');

// default {}
minify.cleanCSS = { removeEmpty: true };

// default {}
minify.uglifyJS = { mangle: false };

var builder = new Builder(__dirname)
  .use(minify);, res){
  if (err) throw err;
  if (res.js) fs.writeFileSync('build/build.js', res.require + res.js);
  if (res.css) fs.writeFileSync('build/build.css', res.css);
npm loves you