0.1.1 • Published 10 years ago

bigpipe-minifier v0.1.1

Weekly downloads
4
License
MIT
Repository
github
Last release
10 years ago

BigPipe - Plugin Minifier

Version npmBuild StatusDependenciesCoverage Status

Minification plugin for the compiler. Currently, only uglify-js and clean-css are supported. Additional minifiers can easily be added, PR's are welcomed.

Install

To install the plugin with the default minification tools:

npm install bigpipe-minifier uglify-js clean-css --save

Usage

The tools that are used for minification have to be passed specifically. This module deliberatly does not ship all required modules. Either a JS or CSS minifier can be passed, or both. The properties on the configuration object will be passed as options to the minification tool. For example, bare_returns and screw_ie8 are passed as options to uglify-js.

var minifier = require('bigpipe-minifier')
  , BigPipe = require('bigpipe');

BigPipe.createServer(8080, {
 minifier: {
    css: {
      name: 'clean-css',
      tool: require('clean-css')
    },
    js: {
      name: 'uglify-js',
      tool: require('uglify-js'),
      bare_returns: true,
      screw_ie8: true
    }
  },
  plugins: [ minifier ]
});

The plugin will capture any emitted register events from the compiler and minify the file content just before it is saved to disk.

License

MIT

0.1.1

10 years ago

0.1.0

10 years ago

0.0.0

10 years ago