bigpipe-minifier

0.1.1 • Public • Published

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

Package Sidebar

Install

npm i bigpipe-minifier

Weekly Downloads

2

Version

0.1.1

License

MIT

Last publish

Collaborators

  • 3rdeden
  • swaagie