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

uglify-loader

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uglify-loader - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

24

index.js
var UglifyJS = require("uglify-js");
var loaderUtils = require('loader-utils');
module.exports = function(content) {
this.cacheable();
module.exports = function(source, inputSourceMap) {
var callback = this.async();
if (this.cacheable) {
this.cacheable();
}
var opts = this.options['uglify-loader'] || {};
// just an indicator to generate source maps, the output result.map will be modified anyway
opts.outSourceMap = "out.map.js";
opts.fromString = true;
return UglifyJS.minify(content, opts).code;
var result = UglifyJS.minify(source, opts);
var sourceFilename = loaderUtils.getRemainingRequest(this);
var current = loaderUtils.getCurrentRequest(this);
var sourceMap = JSON.parse(result.map);
sourceMap.sources = [sourceFilename];
sourceMap.file = current;
sourceMap.sourcesContent = [source];
callback(null, result.code, sourceMap);
};

3

package.json
{
"name": "uglify-loader",
"version": "1.1.0",
"version": "1.2.0",
"description": "Uglify.js loader for webpack",

@@ -24,4 +24,5 @@ "main": "index.js",

"dependencies": {
"loader-utils": "^0.2.7",
"uglify-js": "^2.4.16"
}
}
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