Showing results for uglify-js
Search instead for uglify-es
Minification removes comments and whitespace. Identifiers are renamed to something shorter where possible. Some minifiers also replace "true" with "!0" and stuff like that. Tree-shaking is also getting popular in JS-land. Tree-shaking gets rid of the unused stuff. E.g. if a library got 50 functions, but you're only using 3, only these 3 (and whatever these 3 use and so on) gets included in the final package. Both things are done to reduce the file size. Answer from inu-no-policemen on reddit.com
🌐
npm
npmjs.com › package › uglify-js
uglify-js - npm
August 29, 2024 - JavaScript parser, mangler/compressor and beautifier toolkit. Latest version: 3.19.3, last published: 2 years ago. Start using uglify-js in your project by running `npm i uglify-js`. There are 4760 other projects in the npm registry using uglify-js.
      » npm install uglify-js
    
Published   Aug 29, 2024
Version   3.19.3
Author   Mihai Bazon
🌐
JS Minify
uglifyjs.net
JS Minify and Beautify - Online
Minify your data without hassles or beautify it into a human-readable format. Minify (also known as uglify), in computer science is the process of removing all unnecessary characters from source code without changing its functionality.
Discussions

Why do people “uglify” code?

Minification removes comments and whitespace. Identifiers are renamed to something shorter where possible. Some minifiers also replace "true" with "!0" and stuff like that.

Tree-shaking is also getting popular in JS-land. Tree-shaking gets rid of the unused stuff. E.g. if a library got 50 functions, but you're only using 3, only these 3 (and whatever these 3 use and so on) gets included in the final package.

Both things are done to reduce the file size.

More on reddit.com
🌐 r/learnprogramming
48
61
December 30, 2015
Does uglify-js support es6 and above?
Terser's page is misleading in that case, as it says: "uglify-js does not support ES6+." I guess they refer to previous versions, and not to the newest uglify-js@3 (version 3) - but - still misleading. Anyhow, seems that uglify-js@3 indeed supports ES6... More on stackoverflow.com
🌐 stackoverflow.com
How to use uglify js efficiently?
I am looking into using uglifyjs to minimize my webpack bundle currently my bundle is: 1.13 MB I have installed webpack bundle analyzer and have booted it up and seen the stats it has thrown up. ... More on stackoverflow.com
🌐 stackoverflow.com
Does it make sense to do both minify and uglify?
If the JS file size is too big, it's nearly impossible to understand it unless the entire code is re-written. 2019-09-17T23:32:21.897Z+00:00 ... Uglifying and minifying JavaScript code makes loading pages a little faster and makes code less readable, but not unreadable. More on stackoverflow.com
🌐 stackoverflow.com
🌐
Skalman
skalman.github.io › UglifyJS-online
UglifyJS 3: Online JavaScript minifier
UglifyJS 3 is an excellent tool to help you minify your JavaScript!
🌐
GitHub
github.com › gruntjs › grunt-contrib-uglify
GitHub - gruntjs/grunt-contrib-uglify: Minify files with UglifyJS. · GitHub
In this example, running grunt uglify:my_target will prepend a banner created by interpolating the banner template string with the config object. Here, those properties are the values imported from the package.json file (which are available via the pkg config property) plus today's date.
Starred by 1.5K users
Forked by 347 users
Languages   JavaScript
🌐
GitHub
github.com › mishoo › UglifyJS-old
GitHub - mishoo/UglifyJS-old: JavaScript parser / mangler / compressor / beautifier library for NodeJS
It is developed on NodeJS, but it should work on any JavaScript platform supporting the CommonJS module system (and if your platform of choice doesn’t support CommonJS, you can easily implement it, or discard the exports.* lines from UglifyJS sources). The tokenizer/parser generates an abstract syntax tree from JS code.
Starred by 7.8K users
Forked by 663 users
Languages   JavaScript 99.3% | CSS 0.7% | JavaScript 99.3% | CSS 0.7%
🌐
Lisperator
lisperator.net › uglifyjs
UglifyJS — JavaScript parser, compressor, minifier written in JS
UglifyJS is written in “classic style”, so to say — it's not using the CommonJS module system (I find it more of an annoyance than of real help, especially for prototyping/development). To load it in NodeJS there's a single file that needs to be require-d: tools/node.js.
Find elsewhere
🌐
Simon Willison
til.simonwillison.net › javascript › minifying-uglify-npx
Minifying JavaScript with npx uglify-js | Simon Willison’s TILs
While upgrading CodeMirror in Datasette I figured out how to minify JavaScript using uglify-js on the command line without first installing any teels, using npx (which downloads and executes a CLI tool while skipping the install step):
🌐
KeyCDN
keycdn.com › support › uglifyjs
Minify JavaScript Files with UglifyJS - KeyCDN Support
October 4, 2018 - UglifyJS is best known as a JavaScript minifier. Minification is a valuable performance enhancing technique as it removes whitespace and unnecessary characters within a file to make it smaller and thus, load faster.
🌐
Medium
adamhooper.medium.com › make-uglifyjs-way-faster-by-using-it-sooner-c2c39a9ad27e
Make UglifyJS way faster by using it sooner | by Adam Hooper | Medium
August 1, 2017 - My test bundle ran using uglify-loader in Webpack, on real code. In Overview, a JavaScript-heavy website, I sped JavaScript build by about 50% and removed “development” (un-minified) versions of JavaScript code.
🌐
SourceForge
sourceforge.net › projects › uglifyjs-3.mirror
UglifyJS 3 download | SourceForge.net
August 29, 2024 - UglifyJS is a JavaScript compressor/minifier written in JavaScript. It also contains tools that allow one to automate working with JavaScript code. A parser which produces an abstract syntax tree (AST) from JavaScript code.
🌐
Medium
medium.com › @sayanguha246 › what-does-uglify-mean-in-javascript-db50bcd894d5
What does uglify mean in Javascript? | by Sayan Guha | Medium
October 24, 2019 - Uglify, as it names suggest’s is used to uglify the javascript ie, remove white spaces, change big variable names to small ones and compress the file hence reducing the size of the file and helping with performance.
🌐
Symfony
symfony.com › home › documentation › frontend › assetic › how to minify css/js files (using uglifyjs and uglifycss)
How to Minify CSS/JS Files (Using UglifyJS and UglifyCSS) (Symfony 2.x Docs)
The above example assumes that you have a bundle called AppBundle and your JavaScript files are in the Resources/public/js directory under your bundle. However you can include your JavaScript files no matter where they are. With the addition of the uglifyjs2 filter to the asset tags above, you should now see minified JavaScripts coming over the wire much faster.
🌐
npm
npmjs.com › package › @sheetjs › uglify-js
@sheetjs/uglify-js - npm
May 21, 2020 - UglifyJS is a JavaScript parser, minifier, compressor or beautifier toolkit. This page documents the command line utility. For API and internals documentation see my website. There's also an in-browser online demo (for Firefox, Chrome and probably ...
      » npm install @sheetjs/uglify-js
    
Published   May 21, 2020
Version   2.7.4
Author   Mihai Bazon
🌐
JetBrains
jetbrains.com › help › webstorm › minifying-javascript.html
Minifying JavaScript | WebStorm Documentation
To compress your code automatically, ... a UglifyJS File Watcher which will track changes to your files and run the tool. By default, minification starts as soon as a JavaScript file in the File Watcher's scope is changed and saved. You can specify other events that invoke terser. Learn more from File Watchers. The generated minified code is stored in a separate file with the name of the source JavaScript file and the extension min.js...
🌐
Stack Overflow
stackoverflow.com › questions › 48261576 › how-to-use-uglify-js-efficiently
How to use uglify js efficiently?
If your talking about on the wire compression you don't compress the file, the web server will gzip it when it's served to the client (if you have compression enabled). You don't want to zip your actual js file, minify yes, zip no ... @Liam ok, but how does uglify get involved with making the file smaller and thus making the bundle smaller?
🌐
GitHub
github.com › mishoo › UglifyJS
GitHub - mishoo/UglifyJS: JavaScript parser / mangler / compressor / beautifier toolkit · GitHub
First make sure you have installed the latest version of node.js (You may need to restart your computer after this step). ... UglifyJS can take multiple input files. It's recommended that you pass the input files first, then pass the options. UglifyJS will parse input files in sequence and apply any compression options.
Starred by 13.4K users
Forked by 1.2K users
Languages   JavaScript
Top answer
1 of 3
36

There isn't any real distinction between the two. Even UglifyJS calls itself a minification toolkit.

The distinction could be more relevant when comparing JavaScript minification to CSS minification—CSS minification involves only removing whitespace—the original code remains intact.

With JavaScript, it is possible to not only remove whitespace, but also to make transformations to the code, such as truncating variable names to single characters.

Minifying JavaScript not only makes the source smaller; it also makes the code less readable, or obfuscates it. But do not operate under the assumption that minification or uglification, or whatever you want to call it, is a security measure. It isn't encryption. The code is harder to read, but it is not impossible to read, and while it's not usually possible to return minified code back to its original form, it is possible to 'beautify' it and make it more readable.

It doesn't make sense to both minify and uglify, because most minifiers will both remove whitespace and unnecessary characters, as well as obfuscate the code. All you're doing is introducing another build step.

2 of 3
21

Minifying is just removing unnecessary white-space and redundant like comments and semicolons. And it can be reversed back when needed.

Uglifying is transforming the code into an "unreadable" form by changing variable names, function names, etc., to hide the original content. Once it is used, there isn't any way to reverse it back.

Some libraries, like UglifyJS, does minification when used, by removing unnecessary parts. But in general, uglifying is making the code unreadable.

Minifying your code speeds up your page loading, making visitors and search engines happy, and it is also readable. Most major browsers minify the code before execution.