How to use grunt-contrib-uglify - 2 common examples

To help you get started, we’ve selected a few grunt-contrib-uglify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github thanpolas / mantri / lib / mantri-build-vendor.js View on Github external
/**
 * @fileOverview The vendors part of the build operation.
 */

var fs     = require('fs');
var grunt  = require('grunt');
var __     = require('lodash');
var gUglify = require('grunt-contrib-uglify')().uglify.init( grunt );

var helpers= require('./helpers');

var vendorLibs = module.exports = {};

/**
 * Bundles the vendor libraries into one file and minifies them.
 *
 * Currently using uglify.
 *
 * For unknown reasons certain patterns of libs make
 * closure compiler to blow up (litteraly)
 *
 * @param {Object} buildOpts The build options.
 * @param {Object} options The options object.
 * @return {boolean} success or not.
github sergeche / grunt-frontend / tasks / lib / frontend.js View on Github external
exports.init = function(grunt) {
	var uglify = require('grunt-contrib-uglify/tasks/lib/uglify').init(grunt);
	var cssModule = require('./css');
	var crypto = require('crypto');
	var path = require('path');
	var csso = require('csso');
	var fs = require('fs');
	var _ = require('underscore');

	var exports = {};

	var catalogFile = '.build-catalog.json';
	var reSkipCSSFileName = /^_/;

	function md5(str) {
		return crypto.createHash('md5').update(str).digest("hex");
	}

grunt-contrib-uglify

Minify JavaScript files with UglifyJS

MIT
Latest version published 2 years ago

Package Health Score

62 / 100
Full package analysis