Does it make sense to minify code used in NodeJS?

Minification can improve performance. Node’s V8 optimizing compiler inlines functions according to some heuristics. Minification influences these heuristics. This can cause inlining of previously not inlined functions. Since inlined functions generally perform faster, this can lead to performance improvements. ###Node 9.0+ / V8 6.2+ (Turbofan) – minor performance improvements If the function’s unoptimized bytecode size … Read more

What’s the difference between concat and uglify and minify?

Concatenation is just appending all of the static files into one large file. Minification is just removing unnecesary whitespace and redundant / optional tokens like curlys and semicolons, and can be reversed by using a linter. Uglification is the act of transforming the code into an “unreadable” form, that is, renaming variables/functions to hide the … Read more

How can I take a minified javascript stack trace and run it against a source map to get the proper error?

What you want to do is parse the source maps. This has nothing to do with web browsers. All you need to do is translate the minified reference into the unminified resource. If you have any experience with NodeJS there is already a package that does this for you. https://github.com/mozilla/source-map/ To install the library npm … Read more

Angular.module minification bug

I ran into this problem before with Grunt.js Uglify plugin. One of the options are mangle uglify: { options: { mangle: false }, Which I believe runs regex functions on “like strings” and minifys them. For example: angular.module(“imgur”, [“imgur.global”,”imgur.album”]); Would become: angular.module(“a”, [“a.global”,”a.album”]); Disable it — this feature doesn’t play nice with Angular. Edit: To … Read more

How to concatenate and minify multiple CSS and JavaScript files with Grunt.js (0.3.x)

concat.js is being included in the concat task’s source files public/js/*.js. You could have a task that removes concat.js (if the file exists) before concatenating again, pass an array to explicitly define which files you want to concatenate and their order, or change the structure of your project. If doing the latter, you could put … Read more

HTML minification? [closed]

Perhaps try HTML Compressor, here’s a before and after table showing what it can do (including for Stack Overflow itself): It features many selections for optimizing your pages up to and including script minimizing (ompressor, Google Closure Compiler, your own compressor) where it would be safe. The default option set is quite conservative, so you … Read more

Is there a point to minifying PHP?

PHP is compiled into bytecode, which is then interpreted on top of something resembling a VM. Many other scripting languages follow the same general process, including Perl and Ruby. It’s not really a traditional interpreted language like, say, BASIC. There would be no effective speed increase if you attempted to “minify” the source. You would … Read more