Socket
Socket
Sign inDemoInstall

gulp-uglify-cli

Package Overview
Dependencies
20
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gulp-uglify-cli

Minify javascript by UglifyJs2 with command line options for gulp


Version published
Weekly downloads
58
decreased by-40.82%
Maintainers
1
Install size
302 kB
Created
Weekly downloads
 

Readme

Source

gulp-uglify-cli NPM version

Minify javascript by UglifyJs2 with command line options for gulp.

Installation

npm i -g uglify-js
npm i --save-dev gulp-uglify-cli

Usage

var uglify = require('gulp-uglify-cli')

gulp.task('minifyjs', function(){
  return gulp.src('index.js')
    .pipe(uglify())
    .pipe(gulp.dest('dist'))
})

Options

You can use all command line options in UglifyJs2.

  • String command line option

    uglify('-c -m --screw-ie8')

  • Array command line option

    uglify(['-c', '-m', '--screw-ie8'])

  • Hash option

    uglify({preCommand: 'license.js', command: '-c -m --screw-ie8'})

    By setting output option, you can output file directly.

    uglify({command: '-c', output: '/home/test/output.js'})

    By setting uglifyjs option, you can use custom uglifyjs path.

    uglify({command: '-c', uglifyjs: '/home/node_modules/.bin/uglifyjs'})

    If you have an error 'Permission Denied' in 'gulp-uglify-cli', please try to use tmp option which is accessible file path.

    uglify({command: '-c', tmp: '/tmp/_tmp.js'})

Keywords

FAQs

Last updated on 01 Dec 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc