uglify-loader
Advanced tools
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); | ||
}; |
{ | ||
"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" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
3537
19
0
2
+ Addedloader-utils@^0.2.7
+ Addedbig.js@3.2.0(transitive)
+ Addedemojis-list@2.1.0(transitive)
+ Addedjson5@0.5.1(transitive)
+ Addedloader-utils@0.2.17(transitive)
+ Addedobject-assign@4.1.1(transitive)