包详细信息

gobble-uglifyjs

gobblejs17MIT0.2.1

Minify JavaScript files with gobble and uglifyjs2

gobble, gobble-plugin

自述文件

gobble-uglifyjs

Minify JavaScript files with gobble and uglifyjs2.

Installation

First, you need to have gobble installed - see the gobble readme for details. Then,

npm i -D gobble-uglifyjs

Usage

gobblefile.js

var gobble = require( 'gobble' );
module.exports = gobble( 'src' ).transform( 'uglifyjs' );

If you want the output to have a .min.js extension, add an options argument:

var gobble = require( 'gobble' );
module.exports = gobble( 'src' ).transform( 'uglifyjs', { ext: '.min.js' });

To keep the non-minifed version alongside the result of the transformation:

var gobble = require( 'gobble' ), src = gobble( 'src' );
module.exports = [
  src,
  src.transform( 'uglifyjs', { ext: '.min.js' })
];

By default, sourcemaps are created. To disable, pass a sourceMap: false option.

License

MIT. Copyright 2014-15 Rich Harris

更新日志

changelog

0.2.1

  • Make sourceMap option default to true

0.2.0

  • Support for sourcemaps. This version requires gobble 0.6.3 or higher

0.1.0

  • First release