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

uglifyify

Package Overview
Dependencies
Maintainers
3
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uglifyify - npm Package Compare versions

Comparing version 3.0.4 to 4.0.0

25

index.js

@@ -5,3 +5,3 @@ var minimatch = require('minimatch').Minimatch

, path = require('path')
, ujs = require('uglify-js')
, ujs = require('uglify-es')
, extend = require('extend')

@@ -41,2 +41,7 @@

// remove exts before passing opts to uglify
delete opts.global
delete opts.exts
delete opts.x
return through(function write(chunk) {

@@ -46,13 +51,11 @@ buffer += chunk

var matched = buffer.match(
// match an inlined sourcemap with or without a charset definition
// match an inlined sourceMap with or without a charset definition
/\/\/[#@] ?sourceMappingURL=data:application\/json(?:;charset=utf-8)?;base64,([a-zA-Z0-9+\/]+)={0,2}\n?$/
)
debug = opts.sourcemap !== false && (debug || matched)
debug = opts.sourceMap !== false && (debug || matched)
opts = extend({}, {
fromString: true
, compress: true
, mangle: true
, filename: file
, sourceMaps: debug
sourceMap: {
filename: file
}
}, opts)

@@ -64,3 +67,3 @@

if (debug) opts.outSourceMap = 'out.js.map'
if (debug) opts.sourceMap.url = 'out.js.map'

@@ -70,5 +73,5 @@ // Check if incoming source code already has source map comment.

if (debug && matched) {
opts.inSourceMap = convert.fromJSON(
opts.sourceMap.content = convert.fromJSON(
new Buffer(matched[1], 'base64').toString()
).sourcemap
).sourceMap
}

@@ -75,0 +78,0 @@

{
"name": "uglifyify",
"version": "3.0.4",
"version": "4.0.0",
"description": "A browserify transform which minifies your code using UglifyJS2",

@@ -11,3 +11,3 @@ "main": "index.js",

"through": "~2.3.4",
"uglify-js": "2.x.x"
"uglify-es": "^3.0.15"
},

@@ -14,0 +14,0 @@ "devDependencies": {

# uglifyify
A [Browserify](http://browserify.org) v2 transform which minifies your code
using [UglifyJS2](https://github.com/mishoo/UglifyJS2).
using [uglify-es](https://github.com/mishoo/UglifyJS2/tree/harmony).

@@ -99,5 +99,3 @@ ## Installation

bundler.transform({
global: true
}, 'uglifyify')
bundler.transform('uglifyify', { global: true })

@@ -127,9 +125,9 @@ bundler.bundle()

bundler.transform({
global: true
, ignore: [
bundler.transform('uglifyify', {
global: true,
ignore: [
'**/node_modules/weakmap/*'
, '**/node_modules/async/*'
]
}, 'uglifyify')
})

@@ -177,5 +175,5 @@ bundler.bundle().pipe(process.stdout)

bundler.transform({ sourcemap: false }, 'uglifyify')
bundler.transform('uglifyify', { sourceMap: false })
.bundle()
.pipe(process.stdout)
```
const convert = require('convert-source-map')
const wrap = require('wrap-stream')
const browserify = require('browserify')
const uglify = require('uglify-js')
const uglify = require('uglify-es')
const from2 = require('from2')

@@ -80,3 +80,3 @@ const test = require('tape')

.pipe(closure())
.pipe(uglifyify(src, { compress: false, mangle: false }))
.pipe(uglifyify(src, { compress: { conditionals: false } }))
.pipe(bl(buffered1))

@@ -117,4 +117,5 @@

var min = uglify.minify(orig, {
outSourceMap: 'out.js.map'
, fromString: true
sourceMap: {
url: 'out.js.map'
}
})

@@ -121,0 +122,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