Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-contrib-uglify

Package Overview
Dependencies
Maintainers
4
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-contrib-uglify - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

test/fixtures/expected/multiple_sourcemaps1.js

12

docs/uglify-options.md

@@ -27,6 +27,7 @@ # Options

## sourceMap
Type: `String`
Type: `String` `Function`
Default: `undefined`
Specify the location to output the source map.
The location to output the sourcemap. If a function is provided, the uglify destination is passed as the argument
and the return value will be used as the sourceMap name.

@@ -37,3 +38,3 @@ ## sourceMapRoot

The location where your source files can be found.
The location where your source files can be found. This option sets the root location in the sourcemap file itself.

@@ -47,6 +48,7 @@ ## sourceMapIn

## sourceMappingURL
Type: `String`
Type: `String` `Function`
Default: `undefined`
The location of your sourcemap. Defaults to the location you use for sourceMap, override if you need finer control
The location of your sourcemap. Defaults to the location you use for sourceMap, override if you need finer control. Provide
a function to dynamically generate the sourceMappingURL based off the destination.

@@ -53,0 +55,0 @@ ## sourceMapPrefix

@@ -132,2 +132,16 @@ /*

}
},
multiple_sourcemaps: {
files: {
'tmp/multiple_sourcemaps1.js': ['test/fixtures/src/simple.js'],
'tmp/multiple_sourcemaps2.js': ['test/fixtures/src/comments.js']
},
options: {
sourceMap: function(dest) {
return dest.replace(/\.js$/,".map");
},
sourceMappingURL: function(dest) {
return dest.replace(/\.js$/,".mapurl");
}
}
}

@@ -134,0 +148,0 @@ },

{
"name": "grunt-contrib-uglify",
"description": "Minify files with UglifyJS.",
"version": "0.1.1",
"version": "0.1.2",
"homepage": "https://github.com/gruntjs/grunt-contrib-uglify",

@@ -31,7 +31,7 @@ "author": {

"dependencies": {
"gzip-js": "~0.3.1",
"uglify-js": "~2.2.1"
"uglify-js": "~2.2.1",
"grunt-lib-contrib": "~0.5.3"
},
"devDependencies": {
"grunt-contrib-jshint": "~0.1.1",
"grunt-contrib-jshint": "~0.2.0",
"grunt-contrib-nodeunit": "~0.1.2",

@@ -38,0 +38,0 @@ "grunt-contrib-clean": "~0.4.0",

@@ -16,3 +16,3 @@ # grunt-contrib-uglify [![Build Status](https://secure.travis-ci.org/gruntjs/grunt-contrib-uglify.png?branch=master)](http://travis-ci.org/gruntjs/grunt-contrib-uglify)

One the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

@@ -56,6 +56,7 @@ ```js

#### sourceMap
Type: `String`
Type: `String` `Function`
Default: `undefined`
Specify the location to output the source map.
The location to output the sourcemap. If a function is provided, the uglify destination is passed as the argument
and the return value will be used as the sourceMap name.

@@ -66,3 +67,3 @@ #### sourceMapRoot

The location where your source files can be found.
The location where your source files can be found. This option sets the root location in the sourcemap file itself.

@@ -76,6 +77,7 @@ #### sourceMapIn

#### sourceMappingURL
Type: `String`
Type: `String` `Function`
Default: `undefined`
The location of your sourcemap. Defaults to the location you use for sourceMap, override if you need finer control
The location of your sourcemap. Defaults to the location you use for sourceMap, override if you need finer control. Provide
a function to dynamically generate the sourceMappingURL based off the destination.

@@ -296,2 +298,3 @@ #### sourceMapPrefix

* 2013-01-29   v0.1.2   Added better error reporting Support for dynamic names of multiple sourcemaps
* 2013-02-14   v0.1.1   First official release for Grunt 0.4.0.

@@ -306,2 +309,2 @@ * 2013-01-17   v0.1.1rc6   Updating grunt/gruntplugin dependencies to rc6. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions.

*This file was generated on Mon Feb 18 2013 09:00:20.*
*This file was generated on Mon Feb 25 2013 23:41:32.*

@@ -14,4 +14,4 @@ /*

// Internal lib.
var contrib = require('grunt-lib-contrib').init(grunt);
var uglify = require('./lib/uglify').init(grunt);
var minlib = require('./lib/min').init(grunt);

@@ -31,2 +31,3 @@ grunt.registerMultiTask('uglify', 'Minify files with UglifyJS.', function() {

var banner = grunt.template.process(options.banner);
var mapNameGenerator, mappingURLGenerator;

@@ -45,2 +46,32 @@ // Iterate over all src-dest file pairs.

// function to get the name of the sourceMap
if (typeof options.sourceMap === "function") {
mapNameGenerator = options.sourceMap;
}
// function to get the sourceMappingURL
if (typeof options.sourceMappingURL === "function") {
mappingURLGenerator = options.sourceMappingURL;
}
if (mapNameGenerator) {
try {
options.sourceMap = mapNameGenerator(f.dest);
} catch (e) {
var err = new Error('SourceMapName failed.');
err.origError = e;
grunt.fail.warn(err);
}
}
if (mappingURLGenerator) {
try {
options.sourceMappingURL = mappingURLGenerator(f.dest);
} catch (e) {
var err = new Error('SourceMapName failed.');
err.origError = e;
grunt.fail.warn(err);
}
}
// Minify files, warn and fail on error.

@@ -52,2 +83,5 @@ var result;

var err = new Error('Uglification failed.');
if (e.msg) {
err.message += ', ' + e.msg + '.';
}
err.origError = e;

@@ -73,3 +107,3 @@ grunt.fail.warn(err);

// ...and report some size information.
minlib.info(result.min, result.max);
contrib.minMaxInfo(result.min, result.max);
});

@@ -76,0 +110,0 @@ });

@@ -40,2 +40,6 @@ 'use strict';

'sourcemapin.js',
'multiple_sourcemaps1.js',
'multiple_sourcemaps1.map',
'multiple_sourcemaps2.js',
'multiple_sourcemaps2.map',
];

@@ -42,0 +46,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc