terser
Advanced tools
Comparing version 3.14.1 to 3.16.0
@@ -7,5 +7,5 @@ { | ||
"license": "BSD-2-Clause", | ||
"version": "3.14.1", | ||
"version": "3.16.0", | ||
"engines": { | ||
"node": ">=4.0.0" | ||
"node": ">=6.0.0" | ||
}, | ||
@@ -18,3 +18,3 @@ "maintainers": [ | ||
"repository": "https://github.com/fabiosantoscode/terser.git", | ||
"main": "dist/bundle.js", | ||
"main": "dist/bundle.min.js", | ||
"types": "tools/terser.d.ts", | ||
@@ -26,3 +26,2 @@ "bin": { | ||
"bin", | ||
"lib", | ||
"dist", | ||
@@ -36,3 +35,3 @@ "!dist/bundle.instrumented.js", | ||
"source-map": "~0.6.1", | ||
"source-map-support": "~0.5.6" | ||
"source-map-support": "~0.5.9" | ||
}, | ||
@@ -42,5 +41,6 @@ "devDependencies": { | ||
"coveralls": "^3.0.2", | ||
"csv": "^5.0.0", | ||
"cross-env": "^5.2.0", | ||
"csv": "^5.1.0", | ||
"es6-promise": "^4.2.5", | ||
"escodegen": "^1.9.1", | ||
"escodegen": "^1.11.0", | ||
"eslint": "^4.19.1", | ||
@@ -50,8 +50,10 @@ "eslump": "^2.0.0", | ||
"mocha": "^3.0.0", | ||
"mochallel": "^1.8.2", | ||
"mochallel": "^1.8.6", | ||
"pre-commit": "^1.2.2", | ||
"semver": "~5.5.0" | ||
"rimraf": "^2.6.2", | ||
"rollup": "^1.0.1", | ||
"semver": "~5.5.1" | ||
}, | ||
"scripts": { | ||
"test": "rm -f dist/* && npm run prepare && istanbul instrument dist/bundle.js > dist/bundle.instrumented.js && node test/run-tests.js", | ||
"test": "rimraf dist/* && npm run prepare && istanbul instrument dist/bundle.min.js > dist/bundle.instrumented.js && node test/run-tests.js", | ||
"coverage": "istanbul cover test/run-tests.js", | ||
@@ -61,3 +63,4 @@ "coveralls": "coveralls < coverage/lcov.info", | ||
"lint-fix": "eslint --fix lib", | ||
"prepare": "cd dist && TERSER_NO_BUNDLE=1 ../bin/uglifyjs ../tools/domprops.js ../lib/utils.js ../lib/ast.js ../lib/parse.js ../lib/transform.js ../lib/scope.js ../lib/output.js ../lib/compress.js ../lib/sourcemap.js ../lib/mozilla-ast.js ../lib/propmangle.js ../lib/minify.js ../tools/exports.js -mc -d \"MOZ_SourceMap=require('source-map')\" --source-map \"includeSources=true,url='bundle.js.map'\" -e \"exports:(typeof module != 'undefined' ? module.exports : Terser = {})\" -b beautify=false,ascii_only --comments /license/ -o ../dist/bundle.js" | ||
"prepare": "rollup -c && cd dist && cross-env TERSER_NO_BUNDLE=1 ../bin/uglifyjs bundle.js -mc --source-map 'content=bundle.js.map,includeSources=true,url=bundle.min.js.map' -o bundle.min.js", | ||
"postversion": "echo 'Remember to update the changelog!'" | ||
}, | ||
@@ -84,2 +87,5 @@ "keywords": [ | ||
"eslintConfig": { | ||
"parserOptions": { | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
@@ -99,2 +105,3 @@ "brace-style": [ | ||
"no-debugger": "error", | ||
"no-undef": "error", | ||
"semi": [ | ||
@@ -101,0 +108,0 @@ "error", |
@@ -8,3 +8,3 @@ terser | ||
*note*: You can support this project on patreon: <a target="_blank" rel="nofollow" href="https://www.patreon.com/terser_jscomp_maintainer"><img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" alt="patron" width="100px" height="auto"></a>. Check out PATRONS.md for our first-tier patrons. | ||
*note*: You can support this project on patreon: <a target="_blank" rel="nofollow" href="https://www.patreon.com/terser_ecmacomp_maintainer"><img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" alt="patron" width="100px" height="auto"></a>. Check out PATRONS.md for our first-tier patrons. | ||
@@ -17,3 +17,5 @@ Terser recommends you use RollupJS to bundle your modules, as that produces smaller code overall. | ||
Find the changelog in [CHANGELOG.md](https://github.com/terser-js/terser/blob/master/CHANGELOG.md) | ||
Why choose terser? | ||
@@ -372,2 +374,7 @@ ------------------ | ||
``` | ||
Browser loading is also supported: | ||
```html | ||
<script src="node_modules/source-map/dist/source-map.min.js"></script> | ||
<script src="dist/bundle.min.js"></script> | ||
``` | ||
@@ -1269,6 +1276,6 @@ There is a single high level function, **`minify(code, options)`**, | ||
*note*: You can support this project on patreon: <a target="_blank" rel="nofollow" href="https://www.patreon.com/terser_jscomp_maintainer"><img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" alt="patron" width="100px" height="auto"></a>. Check out PATRONS.md for our first-tier patrons. | ||
*note*: You can support this project on patreon: <a target="_blank" rel="nofollow" href="https://www.patreon.com/terser_ecmacomp_maintainer"><img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" alt="patron" width="100px" height="auto"></a>. Check out PATRONS.md for our first-tier patrons. | ||
* CKEditor ![CKEditor](https://c10.patreonusercontent.com/3/eyJoIjoxMDAsInciOjEwMH0%3D/patreon-media/p/user/15452278/f8548dcf48d740619071e8d614459280/1?token-time=2145916800&token-hash=SIQ54PhIPHv3M7CVz9LxS8_8v4sOw4H304HaXsXj8MM%3D) | ||
* CKEditor ![](https://c10.patreonusercontent.com/3/eyJoIjoxMDAsInciOjEwMH0%3D/patreon-media/p/user/15452278/f8548dcf48d740619071e8d614459280/1?token-time=2145916800&token-hash=SIQ54PhIPHv3M7CVz9LxS8_8v4sOw4H304HaXsXj8MM%3D) | ||
* 38elements ![](https://c10.patreonusercontent.com/3/eyJ3IjoyMDB9/patreon-media/p/user/12501844/88e7fc5dd62d45c6a5626533bbd48cfb/1?token-time=2145916800&token-hash=c3AsQ5T0IQWic0zKxFHu-bGGQJkXQFvafvJ4bPerFR4%3D) |
var fs = require("fs"); | ||
var UglifyJS = exports; | ||
var FILES = UglifyJS.FILES = [ | ||
"./domprops.js", | ||
"../lib/utils.js", | ||
"../lib/ast.js", | ||
"../lib/parse.js", | ||
"../lib/transform.js", | ||
"../lib/scope.js", | ||
"../lib/output.js", | ||
"../lib/compress.js", | ||
"../lib/sourcemap.js", | ||
"../lib/mozilla-ast.js", | ||
"../lib/propmangle.js", | ||
"../lib/minify.js", | ||
"./exports.js", | ||
].map(function(file){ | ||
return require.resolve(file); | ||
}); | ||
var bundle_path = __dirname + "/../dist/bundle.js"; | ||
var UglifyJS = require(bundle_path); | ||
module.exports = UglifyJS; | ||
try { | ||
var istanbul = require("istanbul"); | ||
var instrumenter = new istanbul.Instrumenter(); | ||
} catch (ex) {} | ||
new Function("MOZ_SourceMap", "exports", "require", function() { | ||
var code = FILES.map(function(file) { | ||
var contents = fs.readFileSync(file, "utf8"); | ||
if (instrumenter && global.__IS_TESTING__) return instrumenter.instrumentSync(contents, file); | ||
return contents; | ||
}); | ||
return code.join("\n\n"); | ||
}())( | ||
require("source-map"), | ||
UglifyJS, | ||
require | ||
); | ||
function infer_options(options) { | ||
@@ -41,0 +8,0 @@ var result = UglifyJS.minify("", options); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
3975425
28534
1278
15
17
13
Updatedsource-map-support@~0.5.9