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

grunt-contrib-uglify

Package Overview
Dependencies
Maintainers
6
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.3.2 to 0.3.3

2

package.json
{
"name": "grunt-contrib-uglify",
"description": "Minify files with UglifyJS.",
"version": "0.3.2",
"version": "0.3.3",
"homepage": "https://github.com/gruntjs/grunt-contrib-uglify",

@@ -6,0 +6,0 @@ "author": {

@@ -1,2 +0,2 @@

# grunt-contrib-uglify v0.3.1 [![Build Status](https://travis-ci.org/gruntjs/grunt-contrib-uglify.png?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-uglify)
# grunt-contrib-uglify v0.3.3 [![Build Status](https://travis-ci.org/gruntjs/grunt-contrib-uglify.png?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-uglify)

@@ -29,2 +29,22 @@ > Minify files with UglifyJS.

Task targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide.
### Migrating from 2.x to 3.x
Version `3.x` introduced changes to configuring source maps. Accordingly, if you don't use the source map options you should be able to upgrade seamlessly. If you do use source maps, see below.
#### Removed options
`sourceMapRoot` - The location of your sources is now calculated for you when `sourceMap` is set to `true`
`sourceMapPrefix` - No longer necessary for the above reason
`sourceMappingURL` - Once again, this is calculated automatically
#### Changed options
`sourceMap` - Only accepts a `Boolean` value. Generates a map with a default name for you
#### New options
`sourceMapName` - Accepts a string or function to change the location or name of your map
`sourceMapIncludeSources` - Embed the content of your source files directly into the map
### Options

@@ -132,3 +152,3 @@

This string will be prepended to the beginning of the minified output. It is processed using [grunt.template.process][], using the default options.
This string will be prepended to the minified output. Template strings (e.g. `<%= config.value %>` will be expanded automatically.

@@ -139,9 +159,4 @@ #### footer

This string will be append to the end of the minified output. It is processed using [grunt.template.process][], using the default options.
This string will be appended to the minified output. Template strings (e.g. `<%= config.value %>` will be expanded automatically.
_(Default processing options are explained in the [grunt.template.process][] documentation)_
[grunt.template.process]: http://gruntjs.com/api/grunt.template#grunt.template.process
### Usage examples

@@ -210,3 +225,6 @@

Configure basic source map output by specifying a file path for the `sourceMap` option.
Generate a source map by setting the `sourceMap` option to `true`. The generated
source map will be in the same directory as the destination file. Its name will be the
basename of the destination file with a `.map` extension. Override these
defaults with the `sourceMapName` attribute.

@@ -219,3 +237,4 @@ ```js

options: {
sourceMap: 'path/to/source-map.js'
sourceMap: true,
sourceMapName: 'path/to/sourcemap.map'
},

@@ -232,7 +251,5 @@ files: {

You can specify the parameters to pass to `UglifyJS.SourceMap()` which will
allow you to configure advanced settings.
Set the `sourceMapIncludeSources` option to `true` to embed your sources directly into the map. To include
a source map from a previous compilation pass it as the value of the `sourceMapIn` option.
Refer to the [UglifyJS SourceMap Documentation](http://lisperator.net/uglifyjs/codegen#source-map) for more information.
```js

@@ -244,4 +261,4 @@ // Project configuration.

options: {
sourceMap: 'path/to/source-map.js',
sourceMapRoot: 'http://example.com/path/to/src/', // the location to find your original source
sourceMap: true,
sourceMapIncludeSources: true,
sourceMapIn: 'example/coffeescript-sourcemap.js', // input sourcemap from a previous compilation

@@ -257,3 +274,27 @@ },

Refer to the [UglifyJS SourceMap Documentation](http://lisperator.net/uglifyjs/codegen#source-map) for more information.
#### Discard console.* functions
Specify `drop_console: true` as part of the `compress` options to discard calls to `console.*` functions.
```js
// Project configuration.
grunt.initConfig({
uglify: {
options: {
compress: {
drop_console: true
}
},
my_target: {
files: {
'dest/output.min.js': ['src/input.js']
}
}
}
});
```
#### Beautify

@@ -368,3 +409,4 @@

* 2013-01-22   v0.3.2   fix handling of `sourceMapIncludeSources` option.
* 2013-02-27   v0.3.3   remove unnecessary calls to `grunt.template.process`
* 2014-01-22   v0.3.2   fix handling of `sourceMapIncludeSources` option.
* 2014-01-20   v0.3.1   fix relative path issue in sourcemaps

@@ -390,2 +432,2 @@ * 2014-01-16   v0.3.0   refactor sourcemap support

*This file was generated on Thu Jan 23 2014 09:31:12.*
*This file was generated on Thu Feb 27 2014 17:22:46.*

@@ -59,4 +59,4 @@ /*

// Process banner.
var banner = grunt.template.process(options.banner);
var footer = grunt.template.process(options.footer);
var banner = options.banner;
var footer = options.footer;
var mapNameGenerator, mapInNameGenerator;

@@ -63,0 +63,0 @@

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